CrashEarlyFailureHandler implements FailureHandler { @Override public <A, R> void onUncaughtException(@NonNull A actor, @NonNull Message<A, R> message, @NonNull ActorInvokeException exception) { exception.setMethodSignature(actor.getClass(), message); throw exception; } CrashEarlyFailureHandler(); @Override void onUncaughtException(@NonNull A actor,
                                           @NonNull Message<A, R> message,
                                           @NonNull ActorInvokeException exception);  }
@SuppressWarnings({"unchecked", "ResultOfMethodCallIgnored"}) @Test public void crashIfMessageFailedTest() { final CrashEarlyFailureHandler handler = new CrashEarlyFailureHandler(); boolean thrown = false; try { handler.onUncaughtException(mImpl, mMessage, mThrowable); } catch (RuntimeException e) { thrown = true; Assert.assertSame(mThrowable, e); } Mockito.verify(mThrowable).setMethodSignature(mImpl.getClass(), mMessage); Assert.assertTrue(thrown); }