### Question:
Measure implements Comparable<Measure> { public int compareTo(Measure o) { int measureCompare = this.measureIndex.compareTo(o.measureIndex); if (measureCompare != 0) { return measureCompare; } return Ints.compare(this.trackIndex, o.trackIndex); } Measure(int trackIndex, MeasureId measureIndex, int numberOfBeats, MeasureHeader header, List<Beat> beats); int getTrackIndex(); MeasureId getMeasureIndex(); int getNumberOfBeats(); MeasureHeader getHeader(); List<Beat> getBeats(); int compareTo(Measure o);  }### Answer:
@Test public void testCompareTo() throws Exception { Measure measure1 = new Measure(0, new MeasureId(1), 5, null, null); Measure measure2 = new Measure(0, new MeasureId(2), 5, null, null); Measure measure3 = new Measure(1, new MeasureId(1), 5, null, null); Measure measure4 = new Measure(1, new MeasureId(2), 5, null, null); assertThat(measure1.compareTo(measure1)).isEqualTo(0); assertThat(measure1.compareTo(measure2)).isLessThan(0); assertThat(measure1.compareTo(measure3)).isLessThan(0); assertThat(measure1.compareTo(measure4)).isLessThan(0); assertThat(measure2.compareTo(measure3)).isGreaterThan(0); assertThat(measure2.compareTo(measure4)).isLessThan(0); assertThat(measure4.compareTo(measure1)).isGreaterThan(0); assertThat(measure4.compareTo(measure2)).isGreaterThan(0); assertThat(measure4.compareTo(measure3)).isGreaterThan(0); assertThat(measure4.compareTo(measure4)).isEqualTo(0); }