### Question:
JmsTransactionInfo extends JmsAbstractResource implements Comparable<JmsTransactionInfo> { @Override public void visit(JmsResourceVistor visitor) throws Exception { visitor.processTransactionInfo(this); } JmsTransactionInfo(JmsSessionId sessionId, JmsTransactionId transactionId); JmsTransactionInfo copy(); @Override JmsTransactionId getId(); JmsSessionId getSessionId(); boolean isInDoubt(); void setInDoubt(boolean inDoubt); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(JmsTransactionInfo other); @Override String toString(); @Override void visit(JmsResourceVistor visitor);  }### Answer:
@Test public void testVisit() throws Exception { final JmsTransactionInfo first = new JmsTransactionInfo(firstSessionId, firstTxId); final AtomicBoolean visited = new AtomicBoolean(); first.visit(new JmsDefaultResourceVisitor() { @Override public void processTransactionInfo(JmsTransactionInfo info) { assertEquals(first, info); visited.set(true); } }); assertTrue(visited.get()); }