### Question:
JmsTransactionId extends JmsAbstractResourceId implements Comparable<JmsTransactionId> { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || other.getClass() != JmsTransactionId.class) { return false; } JmsTransactionId tx = (JmsTransactionId) other; return value == tx.value && connectionId.equals(tx.connectionId); } 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 testEquals() { JmsTransactionId id1 = new JmsTransactionId(firstId, 1); JmsTransactionId id2 = new JmsTransactionId(secondId, 2); assertTrue(id1.equals(id1)); assertTrue(id2.equals(id2)); assertFalse(id1.equals(id2)); assertFalse(id2.equals(id1)); assertFalse(id1.equals(null)); assertFalse(id1.equals(new String("TEST"))); JmsTransactionId id3 = new JmsTransactionId(firstId, 1); JmsTransactionId id4 = new JmsTransactionId(firstId, 2); JmsTransactionId id5 = new JmsTransactionId(firstId, 1); assertFalse(id3.equals(id4)); assertTrue(id3.equals(id5)); }