@Test (dataProvider = "hexStrings") public void testHexStringCreation(String hexString, boolean shouldFail, byte[] result) { try { RichHexString rh = new RichHexString(hexString); if (shouldFail) { fail("Creation of hex string with string "+hexString+" should fail."); } assertEquals(rh.getBytes(), result); } catch (IllegalArgumentException e) { if (!shouldFail) { throw e; } } }
public byte[] getBytes() { if (wrapped == null || wrapped.length() == 0) { return new byte[]{}; } return hexStringToByteArray(wrapped); }
RichHexString { public byte[] getBytes() { if (wrapped == null || wrapped.length() == 0) { return new byte[]{}; } return hexStringToByteArray(wrapped); } }
RichHexString { public byte[] getBytes() { if (wrapped == null || wrapped.length() == 0) { return new byte[]{}; } return hexStringToByteArray(wrapped); } RichHexString(String wrapped);  RichHexString(byte[] array); }
RichHexString { public byte[] getBytes() { if (wrapped == null || wrapped.length() == 0) { return new byte[]{}; } return hexStringToByteArray(wrapped); } RichHexString(String wrapped);  RichHexString(byte[] array); String unwrap(); byte[] getBytes(); }
RichHexString { public byte[] getBytes() { if (wrapped == null || wrapped.length() == 0) { return new byte[]{}; } return hexStringToByteArray(wrapped); } RichHexString(String wrapped);  RichHexString(byte[] array); String unwrap(); byte[] getBytes();  }