class DiffUtils {

    public static Map<String, Object> compare(Object left, Object right) {
        Javers javers = JaversBuilder.javers().build();

        Diff diff;
        if (left == null) {
            diff = javers.initial(right);
        } else {
            diff = javers.compare(left, right);
        }

        CustomChangeProcessor changeProcessor = new CustomChangeProcessor();
        javers.processChangeList(diff.getChanges(), changeProcessor);

        Map<String, Object> m = changeProcessor.result();
        removeIfEmpty(m, KEY_PREVIOUS);
        removeIfEmpty(m, KEY_NEW);
        return m;
    }

}