    @Test
    public void decode_broken_tlv() throws TlvException {

        String dataStr = "0011223344556677889900";
        byte[] bytes = Hex.decodeHex(dataStr.toCharArray());
        ByteBuffer b = ByteBuffer.wrap(bytes);

        try {
            TlvDecoder.decode(b);
            fail();
        } catch (TlvException ex) {
            // this is very weak assertion since the format of the exception's message could
            // be changed any time
            assertEquals("Impossible to parse TLV: \n0011223344556677889900", ex.getMessage());
        }
    }