@Test
public void testEquals() {

    SplitIndex index1a = SplitIndex.valueOf(4, false);
    SplitIndex index1b = SplitIndex.valueOf(4, false);
    SplitIndex index2 = SplitIndex.valueOf(5, false);
    SplitIndex index3 = SplitIndex.valueOf(4, true);
    
    assertTrue("Should be equal", index1a.equals(index1b));
    assertFalse("Should not be equal", index1a.equals(index2));
    assertFalse("Should not be equal", index1a.equals(index3));
    
    assertFalse("Null is never equal", index1a.equals(null));
    assertFalse("Unrelated class is never equal", index1a.equals(this));
    
    assertTrue("Same instances should be equal", index1a.equals(index1a));
}