RefreshOnReadPolicy implements ReaderRefreshPolicy, IndexUpdateListener { @Override public void refreshOnReadIfRequired(Runnable refreshCallback) { if (dirty.get()){ refreshWithLock(refreshCallback, false); } } RefreshOnReadPolicy(Clock clock, TimeUnit unit, long refreshDelta); @Override void refreshOnReadIfRequired(Runnable refreshCallback); @Override void refreshOnWriteIfRequired(Runnable refreshCallback); @Override void updated();  }
@Test public void noRefreshOnReadIfNotUpdated() throws Exception{ policy.refreshOnReadIfRequired(refreshCallback); refreshCallback.assertNotInvokedAndReset(); }