### Question:
ServerXAResource extends UnicastExportable implements RemoteXAResource { public Xid[] recover(int flag) throws XAException { Xid[] ids = xaRes.recover(flag); if (ids == null) return new Xid[0]; for (int i = 0; i < ids.length; i++) if ((ids[i] != null) && !(ids[i] instanceof Serializable)) ids[i] = new SerializedXid(ids[i]); return ids; } ServerXAResource(XAResource xaRes, ServerTransactionListener txnListener, Exporter exporter); void commit(Xid xid, boolean onePhase); void end(Xid xid, int flags); void forget(Xid xid); int getTransactionTimeout(); boolean isSameRM(RemoteXAResource remote); int prepare(Xid xid); Xid[] recover(int flag); void rollback(Xid xid); boolean setTransactionTimeout(int seconds); void start(Xid xid, int flags);  }### Answer:
@Test public void testRecover() throws RemoteException, XAException { reset(res); expect(res.recover(42)).andReturn(new Xid[] { xid }); replay(res); assertEquals(new Xid[] { xid }, sx.recover(42)); verify(res); }