@Test
  public void testTimerTrigger() {
    final long time = 10000000; // pick a value that is very far in the future
    ForeignExceptionListener listener = mock(ForeignExceptionListener.class);
    TimeoutExceptionInjector timer = new TimeoutExceptionInjector(listener, time);
    timer.start();
    timer.trigger();
    verify(listener, times(1)).receive(any());
  }
Test that a manually triggered timer fires an exception.
hbase-server/src/test/java/org/apache/hadoop/hbase/errorhandling/TestTimeoutExceptionInjector.java