public static void main(String[] args) {
        //defaults
        String host = "localhost";
        int port = 1337;
        int threadCount = 20;

        if (args.length > 0) {
            host = args[0];
            if (args.length > 1) {
                try {
                    port = Integer.parseInt(args[1]);
                } catch (NumberFormatException ignored) {
                }
            }
            if (args.length > 2) {
                try {
                    threadCount = Integer.parseInt(args[2]);
                } catch (NumberFormatException ignored) {
                }
            }
        }

        final CountDownLatch latch = new CountDownLatch(threadCount);

        try {
            client = new Client(host, port);
            for (int i = 0; i < threadCount; i++) {
                (new Thread() {
                    @Override
                    public void run() {
                        try {
                            callRandomMethod();
                        } catch (Exception e) {
                            log.error("Client failed to execute request", e);
                        } finally {
                            latch.countDown();
                        }
                    }
                }).start();
            }
            latch.await();
            client.disconnect();
        } catch (IOException e) {
            log.error("", e);
        } catch (InterruptedException e) {
            log.error("", e);
        }
    }