JUnit4TestAdapterCache () { return new JUnit4TestAdapterCache() { @Override public RunNotifier getNotifier(final TestResult result, final JUnit4TestAdapter adapter) { RunNotifier notifier = new RunNotifier(); notifier.addListener(new RunListener() { @Override public void testFailure(Failure failure) { result.addError(asTest(failure.getDescription()), failure.getException()); } @Override public void testFinished(Description description) { result.endTest(asTest(description)); } @Override public void testStarted(Description description) { result.startTest(asTest(description)); } @Override public void testIgnored(Description description) { result.addError(asTest(description), IgnoreException.INSTANCE); } @Override public void testAssumptionFailure(Failure failure) { testFailure(failure); } }); return notifier; } }; }