code: static void doDifference(
              Map<String, String> left,
              Map<String, String> right,
              Map<String, String> onlyOnLeft,
              Map<String, String> onlyOnRight,
              Map<String, String> updated
      ) {
          onlyOnRight.clear();
          onlyOnRight.putAll(right);
          for (Map.Entry<String, String> entry : left.entrySet()) {
              String leftKey = entry.getKey();
              String leftValue = entry.getValue();
              if (right.containsKey(leftKey)) {
                  String rightValue = onlyOnRight.remove(leftKey);
                  if (!leftValue.equals(rightValue)) {
                      updated.put(leftKey, leftValue);
                  }
              } else {
                  onlyOnLeft.put(leftKey, leftValue);
              }
          }
      }
docs: calculate the difference of the two maps, so we know what was added, removed & updated
  @param left
  @param right
  @param onlyOnLeft
  @param onlyOnRight
  @param updated