RankableObjectWithFields implements Rankable, Serializable { @Override public int compareTo(Rankable other) { long delta = this.getCount() - other.getCount(); if (delta > 0) { return 1; } else if (delta < 0) { return -1; } else { return 0; } } 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 = "compareToData") public void verifyCompareTo(RankableObjectWithFields first, RankableObjectWithFields second, int expCompareToValue) { assertThat(first.compareTo(second)).isEqualTo(expCompareToValue); }