@Test public void testSimpleArrayDiff_add() throws Exception { JsonCompare cmp = new JsonCompare(); JsonNode doc1 = json("{'a':1,'b':'y','c':true,'d':[1,2,3],'e':[{'q':1,'w':'x'}]}"); JsonNode doc2 = json("{'b':'y','a':1,'c':true,'d':[1,2,4,3],'e':[{'q':1,'w':'x'}]}"); JsonCompare.Difference diff = cmp.compareNodes(doc1, doc2); Assert.assertFalse(diff.same()); Assert.assertEquals(1, diff.getNumChangedFields()); Assert.assertEquals(2, diff.getDelta().size()); Assert.assertTrue(hasDelta(diff.getDelta(), JsonCompare.Addition.class, null, "d.2")); Assert.assertTrue(hasDelta(diff.getDelta(), JsonCompare.Move.class, "d.2", "d.3")); }
@Override protected int size(ArrayNode value) { return value.size(); }
JsonCompare extends DocComparator<JsonNode, ValueNode, ObjectNode, ArrayNode> { @Override protected int size(ArrayNode value) { return value.size(); } }
JsonCompare extends DocComparator<JsonNode, ValueNode, ObjectNode, ArrayNode> { @Override protected int size(ArrayNode value) { return value.size(); }  }
JsonCompare extends DocComparator<JsonNode, ValueNode, ObjectNode, ArrayNode> { @Override protected int size(ArrayNode value) { return value.size(); }  static void main(String[] args); }
JsonCompare extends DocComparator<JsonNode, ValueNode, ObjectNode, ArrayNode> { @Override protected int size(ArrayNode value) { return value.size(); }  static void main(String[] args);  }