@Test
public void testCompareTo() {

    final B2PartSpec a1 = new B2PartSpec(1, 0, 100);
    final B2PartSpec a2 = new B2PartSpec(1, 0, 100);
    assertEquals(0, a1.compareTo(a2));
    // b comes after a1 because it has a higher partNumber
    final B2PartSpec b = new B2PartSpec(2, 0, 100);
    assertTrue(b.compareTo(a1) > 0);
    // c comes after a1 because it has a higher start.
    final B2PartSpec c = new B2PartSpec(1, 1, 100);
    assertTrue(c.compareTo(a1) > 0);
    // d comes after a1 because it has a higher length
    final B2PartSpec d = new B2PartSpec(1, 0, 101);
    assertTrue(d.compareTo(a1) > 0);
}