private static Integer createServerCache(boolean addReplicatedRegion) throws Exception {
    createCache(addReplicatedRegion);
    server = addCacheServer();
    return server.getPort();
  }
This tests whether an exception is thrown in register/unregister when no server is available.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java