private void validateP2PInterface(
      final CommandLine commandLine, final NetworkInterfaceChecker networkInterfaceChecker) {
    final String failMessage = "The provided --p2p-interface is not available: " + p2pInterface;
    try {
      if (!networkInterfaceChecker.isNetworkInterfaceAvailable(p2pInterface)) {
        throw new CommandLine.ParameterException(commandLine, failMessage);
      }
    } catch (final UnknownHostException | SocketException e) {
      throw new CommandLine.ParameterException(commandLine, failMessage, e);
    }
  }
Validates the provided P2P discovery options.

@param commandLine The command line object used for parsing and error reporting.
@param networkInterfaceChecker The checker used to validate the network interface.
app/src/main/java/org/hyperledger/besu/cli/options/P2PDiscoveryOptions.java