public TestHttpServer start() { checkNotStarted(); HttpProcessor httpProcessor = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors); int port = Networking.nextAvailablePort(basePort); ServerBootstrap bootstrap = ServerBootstrap.bootstrap() .setListenerPort(port) .setLocalAddress(getLocalAddress()) .setHttpProcessor(httpProcessor); for (HandlerTuple tuple : handlers) { bootstrap.registerHandler(tuple.path, tuple.handler); } server = bootstrap.create(); try { server.start(); } catch (IOException e) { throw Exceptions.propagate(e); } return this; }