public static void closeCache() {
    if (cache != null && !cache.isClosed()) {
      cache.close();
      cache.getDistributedSystem().disconnect();
    }
  }
closes the cache and disconnects the vm from the distributed system
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/OperationsPropagationDUnitTest.java