void (Set<String> allNames, Object child) { try { if (child instanceof Suite) { final Method getChildrenMethod = Suite.class.getDeclaredMethod("getChildren"); getChildrenMethod.setAccessible(true); final List<?> tests = (List<?>)getChildrenMethod.invoke(child); for (Object test : tests) { final String displayName = describeChild((Runner)test).getDisplayName(); allNames.remove(displayName); } } else if (child instanceof SuiteMethod) { final Method getChildrenMethod = JUnit38ClassRunner.class.getDeclaredMethod("getTest"); getChildrenMethod.setAccessible(true); final Test test = (Test)getChildrenMethod.invoke(child); if (test instanceof TestSuite) { final Enumeration<Test> tests = ((TestSuite)test).tests(); while (tests.hasMoreElements()) { final Test t = tests.nextElement(); if (t instanceof TestSuite) { final String testDescription = ((TestSuite)t).getName(); allNames.remove(testDescription); } } } } } catch (Exception e) { e.printStackTrace(); } }