### Question:
JmsTransactionId extends JmsAbstractResourceId implements Comparable<JmsTransactionId> { @Override public int compareTo(JmsTransactionId o) { int result = connectionId.compareTo(o.connectionId); if (result == 0) { result = (int)(value - o.value); } return result; } JmsTransactionId(JmsConnectionId connectionId, long transactionId); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); @Override int compareTo(JmsTransactionId o); Object getProviderTxId(); long getValue(); JmsConnectionId getConnectionId();  }### Answer:
@Test public void testCompareTo() { JmsTransactionId id1 = new JmsTransactionId(firstId, 1); JmsTransactionId id2 = new JmsTransactionId(secondId, 2); assertEquals(-1, id1.compareTo(id2)); assertEquals(0, id1.compareTo(id1)); assertEquals(1, id2.compareTo(id1)); }