### Question:
XID { public static long getTransactionId(String xid) { if (xid == null) { return -1; } int idx = xid.lastIndexOf(":"); return Long.parseLong(xid.substring(idx + 1)); }  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 testGetTransactionId() { assertThat(XID.getTransactionId(null)).isEqualTo(-1); assertThat(XID.getTransactionId("127.0.0.1:8080:8577662204289747564")).isEqualTo(8577662204289747564L); }