System.out.println("XXXX " + newState);
}
};
client.getConnectionStateListenable().addListener(listener);
timing.sleepABit();
server = new TestingServer(server.getPort());
Assert.assertTrue(timing.awaitLatch(connectedLatch));
timing.sleepABit();
Assert.assertTrue(node.waitForInitialCreate(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS));
server.close();
timing.sleepABit();
server = new TestingServer(server.getPort());
timing.sleepABit();
Assert.assertTrue(timing.awaitLatch(reconnectedLatch));
timing.sleepABit();
Assert.assertEquals(lastState.get(), ConnectionState.RECONNECTED);
}