MessageIdUtils { public static String createMessageId() { final String leftPart = UUID.randomUUID().toString(); final String rightPart = HolodeckB2BCoreInterface.getConfiguration().getHostName(); return leftPart + '@' + rightPart.replaceAll("[^" + VALID_CHARS + "]", "_"); }  static String createMessageId(); static String createContentId(final String msgId); static boolean isAllowed(final String messageId); static boolean isCorrectFormat(final String messageId); static String stripBrackets(final String messageId);  }
@Test public void testCreateMessageId() throws Exception { String id = MessageIdUtils.createMessageId(); assertNotNull(id); String[] parts = id.split("@"); assertTrue(parts.length == 2); assertTrue(parts[0].length()>0); assertEquals(parts[1], hostname); }