@Test public void testRecursiveChildrenIdList() throws Exception { assertThat( tree.getRecursiveChildrenIdList(12), is(list())); assertThat( tree.getRecursiveChildrenIdList(4), is(list(12))); assertThat( tree.getRecursiveChildrenIdList(2), is(list(4, 12, 5, 13, 6, 14, 7, 15))); assertThat( tree.getRecursiveChildrenIdList(5), is(list(13))); assertThat( tree.getRecursiveChildrenIdList(6), is(list(14))); }
public List<Long> getRecursiveChildrenIdList(long id) { return walkChildrenRecursively(id, ImmutableList.<Long>builder(), (builder, child) -> builder.add(child.getId())).build(); }
TaskTree { public List<Long> getRecursiveChildrenIdList(long id) { return walkChildrenRecursively(id, ImmutableList.<Long>builder(), (builder, child) -> builder.add(child.getId())).build(); } }
TaskTree { public List<Long> getRecursiveChildrenIdList(long id) { return walkChildrenRecursively(id, ImmutableList.<Long>builder(), (builder, child) -> builder.add(child.getId())).build(); } TaskTree(List<TaskRelation> rels); }
TaskTree { public List<Long> getRecursiveChildrenIdList(long id) { return walkChildrenRecursively(id, ImmutableList.<Long>builder(), (builder, child) -> builder.add(child.getId())).build(); } TaskTree(List<TaskRelation> rels); long getRootTaskId(); List<Long> getRecursiveParentIdListFromRoot(long id); List<Long> getRecursiveParentsUpstreamChildrenIdListFromFar(long id); T walkChildrenRecursively(long id, T value, Walker<T> walker); List<Long> getRecursiveChildrenIdList(long id); }
TaskTree { public List<Long> getRecursiveChildrenIdList(long id) { return walkChildrenRecursively(id, ImmutableList.<Long>builder(), (builder, child) -> builder.add(child.getId())).build(); } TaskTree(List<TaskRelation> rels); long getRootTaskId(); List<Long> getRecursiveParentIdListFromRoot(long id); List<Long> getRecursiveParentsUpstreamChildrenIdListFromFar(long id); T walkChildrenRecursively(long id, T value, Walker<T> walker); List<Long> getRecursiveChildrenIdList(long id);  }