### Question:
AmqpMessageIdHelper { public static boolean hasMessageIdPrefix(String string) { if (string == null) { return false; } return string.startsWith(JMS_ID_PREFIX); }  static boolean hasMessageIdPrefix(String string); static String toMessageIdString(Object idObject); static String toCorrelationIdString(Object idObject); static Object toIdObject(final String origId); static byte[] convertHexStringToBinary(String hexString); static String convertBinaryToHexString(byte[] bytes); static final String AMQP_STRING_PREFIX; static final String AMQP_UUID_PREFIX; static final String AMQP_ULONG_PREFIX; static final String AMQP_BINARY_PREFIX; static final String AMQP_NO_PREFIX; static final String JMS_ID_PREFIX; }### Answer:
@Test public void testHasIdPrefixWithPrefix() { String myId = "ID:something"; assertTrue("'ID:' prefix should have been identified", AmqpMessageIdHelper.hasMessageIdPrefix(myId)); }
@Test public void testHasIdPrefixWithIDButNoColonPrefix() { String myIdNoColon = "IDsomething"; assertFalse("'ID' prefix should not have been identified without trailing colon", AmqpMessageIdHelper.hasMessageIdPrefix(myIdNoColon)); }
@Test public void testHasIdPrefixWithNull() { String nullString = null; assertFalse("null string should not result in identification as having the prefix", AmqpMessageIdHelper.hasMessageIdPrefix(nullString)); }
@Test public void testHasIdPrefixWithoutPrefix() { String myNonId = "something"; assertFalse("string without 'ID:' anywhere should not have been identified as having the prefix", AmqpMessageIdHelper.hasMessageIdPrefix(myNonId)); }
@Test public void testHasIdPrefixWithLowercaseID() { String myLowerCaseNonId = "id:something"; assertFalse("lowercase 'id:' prefix should not result in identification as having 'ID:' prefix", AmqpMessageIdHelper.hasMessageIdPrefix(myLowerCaseNonId)); }