QueryMonitor { public void setLowMemory(final boolean isLowMemory, final long usedBytes) { memoryState.setLowMemory(executor, isLowMemory, usedBytes, cache); } QueryMonitor(final ScheduledThreadPoolExecutor executor,
      final InternalCache cache,
      final long defaultMaxQueryExecutionTime); void monitorQueryExecution(final ExecutionContext executionContext); void stopMonitoringQueryExecution(final ExecutionContext executionContext); static void throwExceptionIfQueryOnCurrentThreadIsCanceled(); void stopMonitoring(); static boolean isLowMemory(); static long getMemoryUsedBytes(); void setLowMemory(final boolean isLowMemory, final long usedBytes);  }
@Test public void setLowMemoryTrueThenFalseAllowsSubsequentMonitoring() { monitor.setLowMemory(true, 1); monitor.setLowMemory(false, 1); monitorQueryThreadExpirationTaskScheduled(); }