List<Runner> () { final List<Runner> children = new ArrayList<>(super.getChildren()); boolean containsSuiteInside = false; for (Runner child : children) { if (isSuite(child)) { containsSuiteInside = true; break; } } if (!containsSuiteInside) return children; try { final Set<String> allNames = new HashSet<>(); for (Runner child : children) { allNames.add(describeChild(child).getDisplayName()); } for (Runner child : children) { if (isSuite(child)) { skipSuiteComponents(allNames, child); } } for (Iterator<Runner> iterator = children.iterator(); iterator.hasNext(); ) { Runner child = iterator.next(); if (!isSuite(child) && !allNames.contains(describeChild(child).getDisplayName())) { iterator.remove(); } } } catch (Throwable ignored){ } return children; }