### Question:
XID { public static String generateXID(long tranId) { return ipAddress + ":" + port + ":" + tranId; }  static void setPort(int port); static void setIpAddress(String ipAddress); static String generateXID(long tranId); static long getTransactionId(String xid); static int getPort(); static String getIpAddress();  }### Answer:
@Test public void testGenerateXID() { long tranId = new Random().nextLong(); XID.setPort(8080); XID.setIpAddress("127.0.0.1"); assertThat(XID.generateXID(tranId)).isEqualTo(XID.getIpAddress() + ":" + XID.getPort() + ":" + tranId); }