@Test
  public void testDisconnectedListOnClose() throws Exception {
    String connectionId = blockingConnect();
    assertEquals("Disconnect list should be empty", 0, selector.disconnected().size());
    selector.close(connectionId);
    selector.poll(0);
    assertEquals("There should be a disconnect", 1, selector.disconnected().size());
    assertTrue("Expected connectionId " + connectionId + " missing from selector's disconnected list ",
        selector.disconnected().contains(connectionId));
    // make sure that the connection id is not returned via disconnected list after another poll()
    selector.poll(0);
    assertEquals("Disconnect list should be empty", 0, selector.disconnected().size());
  }
Validate that a closed connectionId is returned via disconnected list after close
ambry-network/src/test/java/com/github/ambry/network/SelectorTest.java