void (RunNotifier originalNotifier) { RunNotifier wrapperNotifier = new RunNotifier() { @Override public void addListener(RunListener listener) { originalNotifier.addListener(listener); } @Override public void removeListener(RunListener listener) { originalNotifier.removeListener(listener); } @Override public void fireTestRunStarted(Description description) { originalNotifier.fireTestRunStarted(description); } @Override public void fireTestRunFinished(Result result) { originalNotifier.fireTestRunFinished(result); } @Override public void fireTestStarted(Description description) throws StoppedByUserException { originalNotifier.fireTestStarted(description); } @Override public void fireTestFailure(Failure failure) { if (failure.getException() instanceof AssumptionViolatedException) { originalNotifier.fireTestAssumptionFailed(failure); return; } originalNotifier.fireTestFailure(failure); } @Override public void fireTestAssumptionFailed(Failure failure) { originalNotifier.fireTestAssumptionFailed(failure); } @Override public void fireTestIgnored(Description description) { originalNotifier.fireTestIgnored(description); } @Override public void fireTestFinished(Description description) { originalNotifier.fireTestFinished(description); } @Override public void pleaseStop() { originalNotifier.pleaseStop(); super.pleaseStop(); } }; super.run(wrapperNotifier); }