@Test
  public void testAcceptorImplCloseCleansUp() throws Exception {
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");

    try (InternalCache cache = (InternalCache) new CacheFactory(props).create()) {
      RegionFactory<Object, Object> regionFactory =
          cache.createRegionFactory(RegionShortcut.PARTITION);

      final CacheServer server = cache.addCacheServer();
      final int port = AvailablePortHelper.getRandomAvailableTCPPort();
      server.setPort(port);
      server.start();

      regionFactory.create("region1");

      assertTrue(cache.isServer());
      assertFalse(cache.isClosed());
      await("Acceptor is up and running")
          .until(() -> getAcceptorImplFromCache(cache) != null);

      AcceptorImpl acceptorImpl = getAcceptorImplFromCache(cache);

      cache.close();
      await("Acceptor shuts down properly")
          .until(acceptorImpl::isShutdownProperly);

      assertTrue(cache.isClosed());
      assertFalse(acceptorImpl.isRunning());
    }
  }
GEODE-2324. There was a bug where, due to an uncaught exception, `AcceptorImpl.close()` was
short-circuiting and failing to clean up properly.

What this test does is start a Cache and hook the Acceptor to interrupt the thread before the
place where an InterruptedException could be thrown. It interrupts the thread, and checks that
the thread has terminated normally without short-circuiting. It doesn't check that every part
of the AcceptorImpl has shut down properly -- that seems both difficult to check (especially
since the fields are private) and implementation-dependent.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplDUnitTest.java