BaselineCoexpression implements Comparable<BaselineCoexpression> { @Override public int compareTo(@Nonnull BaselineCoexpression other) { int c = Double.compare(this.ceStatistic(), other.ceStatistic()); return c == 0 ? this.ceGeneID().compareTo(other.ceGeneID()) : c; }  abstract double ceStatistic(); abstract String ceGeneID(); @Override int compareTo(@Nonnull BaselineCoexpression other);  }
@Test void testCompareTo() { assertTrue( BaselineCoexpression.create(0.01, "GENE 2") .compareTo(BaselineCoexpression.create(0.1, "GENE 2")) < 0); }