diff --git a/java/tests/com/google/template/soy/internal/util/TreeStreamsTest.java b/java/tests/com/google/template/soy/internal/util/TreeStreamsTest.java index b356b91ce0..bec0696fa7 100644 --- a/java/tests/com/google/template/soy/internal/util/TreeStreamsTest.java +++ b/java/tests/com/google/template/soy/internal/util/TreeStreamsTest.java @@ -39,7 +39,8 @@ public void testBreadthFirst() { .put(2, list(4, 5)) .put(3, list(6, 7)) .buildOrThrow())) - .containsExactly(1, 2, 3, 4, 5, 6, 7); + .containsExactly(1, 2, 3, 4, 5, 6, 7) + .inOrder(); } @Test @@ -52,7 +53,8 @@ public void testDepthFirst() { .put(2, list(4, 5)) .put(3, list(6, 7)) .buildOrThrow())) - .containsExactly(1, 2, 4, 5, 3, 6, 7); + .containsExactly(1, 2, 4, 5, 3, 6, 7) + .inOrder(); } private static ImmutableList list(T... items) { @@ -65,7 +67,7 @@ private static ImmutableList bfs(T root, Map> data) { } private static ImmutableList dfs(T root, Map> data) { - return TreeStreams.breadthFirst(root, k -> data.getOrDefault(k, ImmutableList.of())) + return TreeStreams.depthFirst(root, k -> data.getOrDefault(k, ImmutableList.of())) .collect(ImmutableList.toImmutableList()); } }