### Question:
ClientXAResource implements XAResource { public void end(Xid xid, int flags) throws XAException { try { remote.end(serialized(xid), flags); } catch (RemoteException e) { throw (XAException) new XAException("RMI faiure").initCause(e); } } ClientXAResource(RemoteXAResource xaRes, ClientTransactionListener txn); void commit(Xid xid, boolean onePhase); void end(Xid xid, int flags); void forget(Xid xid); int getTransactionTimeout(); boolean isSameRM(XAResource xa); int prepare(Xid xid); Xid[] recover(int flag); void rollback(Xid xid); boolean setTransactionTimeout(int seconds); void start(Xid xid, int flag);  }### Answer:
@Test public void testEnd() throws XAException { reset(res); res.end(isA(SerializedXid.class), eq(42)); replay(res); cx.end(xid, 42); verify(res); }