@Test public void testRecursiveParentIdList() throws Exception { assertThat( tree.getRecursiveParentIdListFromRoot(12), is(list(1, 2, 4))); assertThat( tree.getRecursiveParentIdListFromRoot(13), is(list(1, 2, 5))); assertThat( tree.getRecursiveParentIdListFromRoot(14), is(list(1, 2, 6))); assertThat( tree.getRecursiveParentIdListFromRoot(15), is(list(1, 2, 7))); }
public List<Long> getRecursiveParentIdListFromRoot(long id) { return walkParentsRecursively(id, ImmutableList.<Long>builder(), (builder, parent) -> builder.add(parent.getId())).build(); }
TaskTree { public List<Long> getRecursiveParentIdListFromRoot(long id) { return walkParentsRecursively(id, ImmutableList.<Long>builder(), (builder, parent) -> builder.add(parent.getId())).build(); } }
TaskTree { public List<Long> getRecursiveParentIdListFromRoot(long id) { return walkParentsRecursively(id, ImmutableList.<Long>builder(), (builder, parent) -> builder.add(parent.getId())).build(); } TaskTree(List<TaskRelation> rels); }
TaskTree { public List<Long> getRecursiveParentIdListFromRoot(long id) { return walkParentsRecursively(id, ImmutableList.<Long>builder(), (builder, parent) -> builder.add(parent.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> getRecursiveParentIdListFromRoot(long id) { return walkParentsRecursively(id, ImmutableList.<Long>builder(), (builder, parent) -> builder.add(parent.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);  }