@Test
public void testCompareTo()
{

    // field == Field [name='Frank', start=2, length=4]
    String baseName = field.getId();
    int baseStart = field.getStart();
    int baseLength = field.getLength();
    Field fieldIsEqual = new Field(baseName, baseStart, baseLength);
    assertTrue(field.compareTo(fieldIsEqual)==0);
    assertTrue(fieldIsEqual.compareTo(field)==0);
    assertTrue(field.compareTo(field)==0);
    Field startIsLess = new Field(baseName, baseStart - 1, baseLength);
    assertTrue(field.compareTo(startIsLess)>0);
    assertTrue(startIsLess.compareTo(field)<0);
    Field startIsMore = new Field(baseName, baseStart + 1, baseLength);
    assertTrue(field.compareTo(startIsMore)<0);
    assertTrue(startIsMore.compareTo(field)>0);
    Field lengthIsLess = new Field(baseName, baseStart, baseLength - 1);
    assertTrue(field.compareTo(lengthIsLess)>0);
    assertTrue(lengthIsLess.compareTo(field)<0);
    Field lengthIsMore = new Field(baseName, baseStart, baseLength + 1);
    assertTrue(field.compareTo(lengthIsMore)<0);
    assertTrue(lengthIsMore.compareTo(field)>0);
    Field onlyNameIsDifferent = new Field("A"+baseName, baseStart, baseLength);
    assertTrue(field.compareTo(onlyNameIsDifferent)==0);
}