@Override
      public void _setLowMemory(final ScheduledThreadPoolExecutor executor,
          final boolean isLowMemory,
          final long usedBytes,
          final InternalCache cache) {
        if (isLowMemory) {
          memoryState = HEAP_EXHAUSTED;

          /*
           * We need to already be in the HEAP_EXHAUSTED state because we want the
           * cancelation behavior associated with that state.
           */
          cancelAllQueries(executor);
        }
        // Otherwise, no state change
      }
This enum (an abstract base class or ABC) and its enum constants (subclasses of the ABC)
play the role of "ConcreteState" classes in the GoF "State" pattern.

See {@link MemoryState} for details.
geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryMonitor.java