ListenerFactory listenerFactory = new ListenerFactory();
listenerFactory.setPort(TestUtil.findFreePort());
// let's create two listeners on the same port, second should not start
Listener defaultListener = listenerFactory.createListener();
Listener secondListener = listenerFactory.createListener();
serverFactory.addListener("default", defaultListener);
serverFactory.addListener("second", secondListener);