@Test public void detectsDeeplyNestedDifferences() { Node expected = Node.objectNode() .withMember("foo", Node.arrayNode().withValue(Node.from("bar")).withValue( Node.objectNode() .withMember("baz", Node.arrayNode() .withValue(Node.from("snap")) .withValue(Node.objectNode() .withMember("crackle", Node.from("pop")))))); Node actual = Node.objectNode() .withMember("foo", Node.arrayNode() .withValue(Node.from("bar")) .withValue(Node.objectNode() .withMember("baz", Node.arrayNode().withValue(Node.from("snap")) .withValue(Node.objectNode() .withMember("crackle", Node.from("quux")))))); assertThat(NodeDiff.diff(actual, expected), contains( "[/foo[1]/baz[1]/crackle]: Expected `\"pop\"` but found `\"quux\"`")); }
static List<String> diff(ToNode actual, ToNode expected) { return new NodeDiff().findDifferences(actual.toNode(), expected.toNode(), "") .collect(Collectors.toList()); }
NodeDiff { static List<String> diff(ToNode actual, ToNode expected) { return new NodeDiff().findDifferences(actual.toNode(), expected.toNode(), "") .collect(Collectors.toList()); } }
NodeDiff { static List<String> diff(ToNode actual, ToNode expected) { return new NodeDiff().findDifferences(actual.toNode(), expected.toNode(), "") .collect(Collectors.toList()); } NodeDiff(); }
NodeDiff { static List<String> diff(ToNode actual, ToNode expected) { return new NodeDiff().findDifferences(actual.toNode(), expected.toNode(), "") .collect(Collectors.toList()); } NodeDiff();  }
NodeDiff { static List<String> diff(ToNode actual, ToNode expected) { return new NodeDiff().findDifferences(actual.toNode(), expected.toNode(), "") .collect(Collectors.toList()); } NodeDiff();   }