TimeUnitComparator implements Comparator<TimeUnit>, Serializable { public int compare(final TimeUnit left, final TimeUnit right) { if (left.getMillisPerUnit() < right.getMillisPerUnit()) { return -1; } else if (left.getMillisPerUnit() > right.getMillisPerUnit()) { return 1; } return 0; }  int compare(final TimeUnit left, final TimeUnit right);  }
@Test public void testComparingOrder() throws Exception { TimeUnitComparator comparator = new TimeUnitComparator(); assertEquals(-1, comparator.compare(new Hour(), new Day())); }