public static void main(String... arguments) {
        try {
            Map<String, String> parsedArguments = parseArguments(arguments);

            MOCK_SERVER_LOGGER.debug(SERVER_CONFIGURATION, "Using command line options: {}", Joiner.on(", ").withKeyValueSeparator("=").join(parsedArguments));

            if (parsedArguments.size() > 0 && parsedArguments.containsKey(serverPort.name())) {
                if (parsedArguments.containsKey(logLevel.name())) {
                    ConfigurationProperties.logLevel(parsedArguments.get(logLevel.name()));
                }
                Integer[] localPorts = INTEGER_STRING_LIST_PARSER.toArray(parsedArguments.get(serverPort.name()));
                if (parsedArguments.containsKey(proxyRemotePort.name())) {
                    String remoteHost = parsedArguments.get(proxyRemoteHost.name());
                    if (Strings.isNullOrEmpty(remoteHost)) {
                        remoteHost = "localhost";
                    }
                    new MockServer(Integer.parseInt(parsedArguments.get(proxyRemotePort.name())), remoteHost, localPorts);
                } else {
                    new MockServer(localPorts);
                }
            } else {
                showUsage();
            }
        } catch (IllegalArgumentException iae) {
            showUsage();
        }
    }
public static void main ( String ... arguments ) { try { Map < String , String > parsedArguments = parseArguments ( arguments ) ; MOCK_SERVER_LOGGER . debug ( SERVER_CONFIGURATION , "Using command line options: {}" , Joiner . on ( ", " ) . withKeyValueSeparator ( "=" ) . join ( parsedArguments ) ) ; if ( parsedArguments . size ( ) > 0 && parsedArguments . containsKey ( serverPort . name ( ) ) ) { if ( parsedArguments . containsKey ( logLevel . name ( ) ) ) { ConfigurationProperties . logLevel ( parsedArguments . get ( logLevel . name ( ) ) ) ; } Integer [ ] localPorts = INTEGER_STRING_LIST_PARSER . toArray ( parsedArguments . get ( serverPort . name ( ) ) ) ; if ( parsedArguments . containsKey ( proxyRemotePort . name ( ) ) ) { String remoteHost = parsedArguments . get ( proxyRemoteHost . name ( ) ) ; if ( Strings . isNullOrEmpty ( remoteHost ) ) { remoteHost = "localhost" ; } new MockServer ( Integer . parseInt ( parsedArguments . get ( proxyRemotePort . name ( ) ) ) , remoteHost , localPorts ) ; } else { new MockServer ( localPorts ) ; } } else { showUsage ( ) ; } } catch ( IllegalArgumentException iae ) { showUsage ( ) ; } }
Run the MockServer directly providing the arguments as specified below.

@param arguments the entries are in pairs:
- "-serverPort"       followed by the mandatory server local port,
- "-proxyRemotePort"  followed by the optional proxyRemotePort port that enabled port forwarding mode,
- "-proxyRemoteHost"  followed by the optional proxyRemoteHost port (ignored unless proxyRemotePort is specified)
- "-logLevel"         followed by the log level