@Test
  public void testOpenSocketCloser() {
    final AtomicBoolean beforeSocketCloseRunnableWasCalled = new AtomicBoolean();
    final AtomicBoolean afterSocketCloseRunnableWasCalled = new AtomicBoolean();

    final Socket closableSocket = createClosableSocket();
    socketCloser.asyncClose(closableSocket, "A",
        () -> beforeSocketCloseRunnableWasCalled.set(true),
        () -> afterSocketCloseRunnableWasCalled.set(true));
    await().until(beforeSocketCloseRunnableWasCalled::get);
    await().until(closableSocket::isClosed);
    await().until(afterSocketCloseRunnableWasCalled::get);
  }
Verify that requesting an asyncClose on an already closed socket is a noop.
geode-core/src/integrationTest/java/org/apache/geode/internal/net/SocketCloserIntegrationTest.java