public static String id(Object key) { if (key instanceof XidImpl) { byte[] globalId = ((XidImpl) key).getGlobalTransactionId(); StringBuilder buffer = new StringBuilder(); for (byte aGlobalId : globalId) { buffer.append(Integer.toHexString(aGlobalId)); } return buffer.toString().replaceAll("0*$", ""); } return key.toString(); }