JUnit4Builder () { return new JUnit4Builder() { @Override public Runner runnerForClass(Class testClass) throws Throwable { if (!recursively) return super.runnerForClass(testClass); try { Method ignored = BlockJUnit4ClassRunner.class.getDeclaredMethod("isIgnored", FrameworkMethod.class); return new BlockJUnit4ClassRunner(testClass) { @Override protected boolean isIgnored(FrameworkMethod child) { return false; } }; } catch (NoSuchMethodException ignored) {} //older versions return new BlockJUnit4ClassRunner(testClass) { @Override protected void runChild(FrameworkMethod method, RunNotifier notifier) { final Description description = describeChild(method); final EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description); eachNotifier.fireTestStarted(); try { methodBlock(method).evaluate(); } catch (AssumptionViolatedException e) { eachNotifier.addFailedAssumption(e); } catch (Throwable e) { eachNotifier.addFailure(e); } finally { eachNotifier.fireTestFinished(); } } }; } }; }