client.addConnectionListener(listener, metadata);
// Test pingPeriod.
Field field = Client.class.getDeclaredField("connectionValidator");
field.setAccessible(true);
ConnectionValidator validator = (ConnectionValidator) field.get(client);
field = ConnectionValidator.class.getDeclaredField("pingPeriod");
field.setAccessible(true);
long pingPeriod = ((Long) field.get(validator)).longValue();
assertEquals(ConnectionValidator.DEFAULT_PING_PERIOD, pingPeriod);