RangePartition extends PredicateValue { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof RangePartition)) { return false; } return label.equals(((RangePartition)obj).getLabel()); } RangePartition(String label);  RangePartition(String key, long fromInclusive, long toInclusive, boolean isNeg); String getLabel(); @Override RangePartition clone(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void requireThatEqualsIsImplemented() { RangePartition lhs = new RangePartition("foo=10-19"); assertTrue(lhs.equals(lhs)); assertFalse(lhs.equals(new Object())); RangePartition rhs = new RangePartition("bar=1000-1999"); assertFalse(lhs.equals(rhs)); rhs = new RangePartition("foo=10-19"); assertTrue(lhs.equals(rhs)); }