@Test
public void testToIdObjectWithStringContainingBinaryHexThrowsWithNonHexCharacters() {

    // char before '0'
    char nonHexChar = '/';
    String nonHexString = AMQPMessageIdHelper.AMQP_BINARY_PREFIX + nonHexChar + nonHexChar;
    try {
        messageIdHelper.toIdObject(nonHexString);
        fail("expected exception was not thrown");
    } catch (AmqpProtocolException ex) {
        // expected
    }
    // char after '9', before 'A'
    nonHexChar = ':';
    nonHexString = AMQPMessageIdHelper.AMQP_BINARY_PREFIX + nonHexChar + nonHexChar;
    try {
        messageIdHelper.toIdObject(nonHexString);
        fail("expected exception was not thrown");
    } catch (AmqpProtocolException ex) {
        // expected
    }
    // char after 'F', before 'a'
    nonHexChar = 'G';
    nonHexString = AMQPMessageIdHelper.AMQP_BINARY_PREFIX + nonHexChar + nonHexChar;
    try {
        messageIdHelper.toIdObject(nonHexString);
        fail("expected exception was not thrown");
    } catch (AmqpProtocolException ex) {
        // expected
    }
    // char after 'f'
    nonHexChar = 'g';
    nonHexString = AMQPMessageIdHelper.AMQP_BINARY_PREFIX + nonHexChar + nonHexChar;
    try {
        messageIdHelper.toIdObject(nonHexString);
        fail("expected exception was not thrown");
    } catch (AmqpProtocolException ex) {
        // expected
    }
}