public boolean equals(Object other) {
    if (other instanceof Key2) {
      Key2 k1 = (Key2) other;
      return k1.getId().equals(id) && k1.getName().equals(name);
    } else {
      return false;
    }
  }
Sample class for Data DUnit tests with JSON keys and values
geode-junit/src/main/java/org/apache/geode/management/internal/cli/dto/Key2.java