public static void main(String[] args) throws Exception { int port = args.length > 0 ? Integer.parseInt(args[0]) : IOUtils.chooseFreePort(); try (LocalZKServer zkServer = new LocalZKServer(port)) { JVMUtils.closeAtShutdown(zkServer); zkServer.start(); zkServer.await(); } }