@Test(dataProvider = "compareToData") public void verifyCompareTo(RankableObjectWithFields first, RankableObjectWithFields second, int expCompareToValue) { assertThat(first.compareTo(second)).isEqualTo(expCompareToValue); }
@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 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 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); }
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); @Override Object getObject(); @Override long getCount(); List<Object> getFields(); @Override int compareTo(Rankable other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override Rankable copy(); }
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); @Override Object getObject(); @Override long getCount(); List<Object> getFields(); @Override int compareTo(Rankable other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override Rankable copy();  }