RankableObjectWithFields implements Rankable, Serializable { @Override public int hashCode() { int result = 17; int countHash = (int) (count ^ (count >>> 32)); result = 31 * result + countHash; result = 31 * result + obj.hashCode(); return result; } RankableObjectWithFields(Object obj, long count, Object... otherFields); static RankableObjectWithFields from(Tuple tuple); Object getObject(); long getCount(); List<Object> getFields(); @Override int compareTo(Rankable other); @Override boolean equals(Object o); @Override int hashCode(); String toString(); @Override Rankable copy();  }
@Test(dataProvider = "falseDuplicatesData") public void shouldHaveDifferentHashCodeThanFalseDuplicates(RankableObjectWithFields r, RankableObjectWithFields falseDuplicate) { assertThat(r.hashCode()).isNotEqualTo(falseDuplicate.hashCode()); }
@Test(dataProvider = "trueDuplicatesData") public void shouldHaveSameHashCodeAsTrueDuplicates(RankableObjectWithFields r, RankableObjectWithFields trueDuplicate) { assertThat(r.hashCode()).isEqualTo(trueDuplicate.hashCode()); }