code: public Difference<BaseType> compareObjects(List<String> field1,
                                                 ObjectType node1,
                                                 List<String> field2,
                                                 ObjectType node2)
              throws InvalidArrayIdentity, DuplicateArrayIdentity {
          Difference<BaseType> ret = new Difference<>();
          // Field by field comparison of obj1 to obj2. 
          for (Iterator<Map.Entry<String, BaseType>> fields = getFields(node1); fields.hasNext();) {
              Map.Entry<String, BaseType> field = fields.next();
              String fieldName = field.getKey();
              field1.add(fieldName);
              BaseType value1 = field.getValue();
  
              if (hasField(node2, fieldName)) {
                  // If both obj1 and obj2 have the same field, compare recursively
                  field2.add(fieldName);
                  BaseType value2 = getField(node2, fieldName);
                  ret.add(compareNodes(field1, value1, field2, value2));
                  pop(field2);
              } else {
                  // obj1.field1 exists, obj2.field1 does not, so it is removed
                  ret.add(new Removal(field1, value1));
              }
              pop(field1);
          }
          // Now compare any new nodes added to obj2
          for (Iterator<Map.Entry<String, BaseType>> fields = getFields(node2); fields.hasNext();) {
              Map.Entry<String, BaseType> field = fields.next();
              String fieldName = field.getKey();
              if (!hasField(node1, fieldName)) {
                  field2.add(fieldName);
                  ret.add(new Addition(field2, field.getValue()));
                  pop(field2);
              }
          }
          return ret;
      }
docs: Compares two object nodes recursively and returns the differences