(This is just a question out of convenience. Right now I'm doing it manually, but ideally, there should be a library that already takes care of this, but I just couldn't find any.)

Basically, I'd like to take two objects A and B of the same class (same one, no inheritance) and create a new one with just the differences that were introduced in B for every field, keeping the remaining fields set to null. Of course I could just manually call every single getter and do an equals, then set the field, but that would be a lot of boilerplate.

So far I was only able to find solutions for *comparing* two objects, as in, all that would be returned is a boolean. But that wouldn't take away the problem of still having to manually check every single field. I had something like this in mind:

```
class MyPojo {
   private String field1;
   private String field2;
   private String field3;

   // ... getters and setters here ...
}

MyPojo oldObj = new MyPojo("a", "b", "c");
MyPojo newObj = new MyPojo("a", "b", "x");

MyPojo diff = createDifferenceObject(oldObj, newObj);
assert(diff.getField1() == null);
assert(diff.getField2() == null);
assert(diff.getField3() == "x");

public MyPojo createDifferenceObject(MyPojo oldObj, MyPojo newObj) {
   return TheMagicLibraryIAmLookingFor.createDifferenceView(oldObj, newObj);
}

```