### Question:
ParentRunnerSpy { static <T> List<T> getFilteredChildren(ParentRunner<T> parentRunner) { try { return new ArrayList<>((Collection<T>) getFilteredChildrenMethod.invoke(parentRunner)); } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Failed to invoke getFilteredChildren()", e); } } private  ParentRunnerSpy();   }### Answer:
@Test public void testGetFilteredChildren() throws Exception { List<String> children = ParentRunnerSpy.getFilteredChildren(new ParentRunner<String>(ParentRunnerSpyTest.class) { @Override protected List<String> getChildren() { ArrayList<String> children = new ArrayList<>(); children.add("children"); return children; } @Override protected Description describeChild(String o) { return null; } @Override protected void runChild(String o, RunNotifier runNotifier) {} }); assertEquals(1, children.size()); assertEquals("children", children.get(0)); }