LoggingUncaughtExceptionHandler { public static void setFailureSetter(final FailureSetter failureSetter) { handler.setFailureSetter(failureSetter); } LoggingUncaughtExceptionHandler(); static UncaughtExceptionHandler getInstance(); static void setOnThread(final Thread thread); static void setFailureSetter(final FailureSetter failureSetter); static int getUncaughtExceptionsCount(); static void clearUncaughtExceptionsCount();  }
@Test public void verifySetFailureCalledWhenUncaughtExceptionCalledWithVirtualMachineError() { Logger logger = mock(Logger.class); Thread thread = mock(Thread.class); VirtualMachineError error = mock(VirtualMachineError.class); FailureSetter failureSetter = mock(FailureSetter.class); Implementation handler = new Implementation(logger); handler.setFailureSetter(failureSetter); handler.uncaughtException(thread, error); verify(failureSetter).setFailure(error); }