### Question:
SequenceItem implements Comparable<SequenceItem> { @Override public int compareTo(SequenceItem arg0) { if (index != arg0.getIndex()) { return index - arg0.getIndex(); } return symbol.compareTo(arg0.getSymbol()); } SequenceItem(String item, int index); String getSymbol(); int getIndex(); @Override int hashCode(); @Override boolean equals(Object obj); static String getDittedString(List<SequenceItem> itemList, int totalLength); @Override String toString(); @Override int compareTo(SequenceItem arg0);  }### Answer:
@Test public void comparisonTests() { SequenceItem a1 = new SequenceItem("A", 0); SequenceItem a2 = new SequenceItem("A", 0); assertEquals(0, a1.compareTo(a1)); assertEquals(0, a1.compareTo(a2)); assertEquals(0, a2.compareTo(a1)); SequenceItem a3 = new SequenceItem("A", 1); assertTrue(a1.compareTo(a3) < 0); assertEquals(a1.compareTo(a3), -a3.compareTo(a1)); SequenceItem b1 = new SequenceItem("B", 0); assertTrue(a1.compareTo(b1) < 0); assertTrue(b1.compareTo(a3) < 0); }