ndimiduk commented on a change in pull request #1922: URL: https://github.com/apache/hbase/pull/1922#discussion_r446323076
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/MergeNormalizationPlan.java ########## @@ -78,4 +82,30 @@ public void execute(Admin admin) { LOG.error("Error during region merge: ", ex); } } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + + if (o == null || getClass() != o.getClass()) { + return false; + } + + MergeNormalizationPlan that = (MergeNormalizationPlan) o; + + return new EqualsBuilder() + .append(firstRegion, that.firstRegion) + .append(secondRegion, that.secondRegion) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37) Review comment: From [javadoc](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)) on `Object#equals(Object)` > Note that it is generally necessary to override the `hashCode` method whenever this method is overridden, so as to maintain the general contract for the `hashCode` method, which states that equal objects must have equal hash codes. And besides since I want to treat these objects like POJOs, it is useful to be able to use them in maps and sets. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org