ExpiryTask extends SystemTimer.SystemTimerTask { @Override public void run2() { try { if (executor != null) { executor.execute(new Runnable() { @Override public void run() { runInThreadPool(); } }); } else { runInThreadPool(); } } catch (RejectedExecutionException ex) { try { if (logger.isDebugEnabled()) { logger.debug("Rejected execution in expiration task", ex); } } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); throw err; } catch (Throwable t) { SystemFailure.checkFailure(); t.printStackTrace(); } } catch (CancelException e) { return; } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); throw err; } catch (Throwable ex) { SystemFailure.checkFailure(); logger.fatal("Exception in expiration task", ex); } } protected  ExpiryTask(LocalRegion region); long getExpirationTime(); long getTTLExpirationTime(); long getIdleExpirationTime(); static void suspendExpiration(); static void permitExpiration(); @Override boolean cancel(); @Override void run2(); @Override String toString(); abstract boolean isPending(); abstract Object getKey(); long calculateNow(); static long calculateNow(InternalCache cache); @MutableForTesting
  static ExpiryTaskListener expiryTaskListener; }
@Test public void shouldBeMockable() throws Exception { ExpiryTask mockExpiryTask = mock(ExpiryTask.class); mockExpiryTask.run2(); verify(mockExpiryTask, times(1)).run2(); }