@Test
    public void changeServerStatusByPingShouldBeReceivedByListener() throws InterruptedException {
        final PingConstant ping = new PingConstant();
        // Start with a ping where both servers are down.
        ping.setConstant(false);
        lb.setPing(ping);
        lb.forceQuickPing();
        // We should see that the servers that changed status are both server1 and 2.
        assertThat(serversReceivedByListener.get(), allOf(hasItem(server1), hasItem(server2)));

        // Bring both servers back up.
        ping.setConstant(true);
        // Clear the list so we can see the change-list is non-empty after the listener is called.
        serversReceivedByListener.set(null);
        lb.forceQuickPing();
        assertFalse(serversReceivedByListener.get().isEmpty());
        assertThat(serversReceivedByListener.get(), allOf(hasItem(server1), hasItem(server2)));
    }
A load balancer that has all the functionality of the Base one except it does not
schedule any ping tasks that can concurrently update the state of the LB by either
causing forced pings to be dropped or changing the expected state of the test before
we assert our invariants.
ribbon-loadbalancer/src/test/java/com/netflix/loadbalancer/ServerStatusChangeListenerTest.java