public static InternalCache getAnyInstance() {
    synchronized (InternalCacheBuilder.class) {
      InternalCache instance = GemFireCacheImpl.getInstance();
      if (instance == null) {
        throw new CacheClosedException(
            "A cache has not yet been created.");
      } else {
        instance.getCancelCriterion().checkCancelInProgress(null);
        return instance;
      }
    }
  }
@throws CacheClosedException if a cache has not been created or the only created one is
        {@link Cache#isClosed closed}
geode-core/src/main/java/org/apache/geode/internal/cache/CacheFactoryStatics.java