CachingContext implements Closeable { public void invalidateAll(boolean async) { if (async) { executorService.execute(new Runnable() { @Override public void run() { safeInvalidateAll(builderFactory); } }); } else { safeInvalidateAll(builderFactory); } } CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory,
                          ExecutorService executorService);  CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory); void invalidateAll(boolean async); void invalidate(final String experimentName, boolean async); void update(Experiment experiment); void delete(String experimentName); boolean checkIfAnyStale(); boolean checkIfStale(String experimentName); @Override void close();  }
@Test public void testInvalidateAll() { context.invalidateAll(false); verifyZeroInteractions(executorService); verify(cache).invalidateAll(any(Experiment.BuilderFactory.class)); }
@Test public void testInvalidateAllAsync() { context.invalidateAll(true); verify(executorService).execute(any(Runnable.class)); }