### Question:
Walker { @SafeVarargs public final Stream<N> postOrderFrom(N... startNodes) { return postOrderFrom(nonNullList(startNodes)); } Walker(); static BinaryTreeWalker<N> inBinaryTree(
      UnaryOperator<N> getLeft, UnaryOperator<N> getRight); static Walker<N> inTree(
      Function<? super N, ? extends Stream<? extends N>> findChildren); static GraphWalker<N> inGraph(
      Function<? super N, ? extends Stream<? extends N>> findSuccessors); static GraphWalker<N> inGraph(
      Function<? super N, ? extends Stream<? extends N>> findSuccessors,
      Predicate<? super N> tracker); @SafeVarargs final Stream<N> preOrderFrom(N... startNodes); abstract Stream<N> preOrderFrom(Iterable<? extends N> startNodes); @SafeVarargs final Stream<N> postOrderFrom(N... startNodes); abstract Stream<N> postOrderFrom(Iterable<? extends N> startNodes); @SafeVarargs final Stream<N> breadthFirstFrom(N... startNodes); abstract Stream<N> breadthFirstFrom(Iterable<? extends N> startNodes);  }### Answer:
@Test public void postOrder_noChildren() { assertThat(dataType.newWalker().postOrderFrom("root")).containsExactly("root"); }
@Test public void postOrder_emptyStartNodes() { Walker<String> walker = dataType.newWalker(ImmutableListMultimap.of("foo", "bar")); assertThat(walker.postOrderFrom(ImmutableList.of())).isEmpty(); }
@Test public void postOrder_oneEdge() { Walker<String> walker = dataType.newWalker(ImmutableListMultimap.of("foo", "bar")); assertThat(walker.postOrderFrom("foo")).containsExactly("bar", "foo").inOrder(); }
@Test public void postOrder_twoEdges() { Walker<String> walker = dataType.newWalker(ImmutableListMultimap.of("foo", "bar", "bar", "baz")); assertThat(walker.postOrderFrom("foo")).containsExactly("baz", "bar", "foo").inOrder(); }
@Test public void postOrder_depthFirst() { Walker<String> walker = dataType.newWalker(ImmutableListMultimap.of("foo", "bar", "foo", "baz", "bar", "dog")); assertThat(walker.postOrderFrom("foo")).containsExactly("dog", "bar", "baz", "foo").inOrder(); }
@Test public void postOrder_disjointRoots() { Walker<String> walker = dataType.newWalker( ImmutableListMultimap.of("foo", "bar", "bar", "dog", "zoo", "cat", "zoo", "lion")); assertThat(walker.postOrderFrom("foo", "zoo")) .containsExactly("dog", "bar", "foo", "cat", "lion", "zoo") .inOrder(); }
@Test public void postOrder_graph_connectedRoots() { Walker<String> walker = DataType.GRAPH.newWalker( ImmutableListMultimap.of("foo", "bar", "bar", "dog", "zoo", "dog", "zoo", "cat")); assertThat(walker.postOrderFrom("foo", "zoo")) .containsExactly("cat", "zoo", "dog", "bar", "foo") .inOrder(); }
@Test public void postOrder_tree_connectedRoots() { Walker<String> walker = DataType.TREE.newWalker( ImmutableListMultimap.of("foo", "bar", "bar", "dog", "zoo", "dog", "zoo", "cat")); assertThat(walker.postOrderFrom("foo", "zoo")) .containsExactly("dog", "bar", "foo", "cat", "dog", "zoo") .inOrder(); }