### Question:
ByteUtils { public static String toString(final byte[] bytes) { final StringBuilder builder = new StringBuilder(); builder.append("{ "); for (final byte b : bytes) { builder.append(String.format("%02X ", (byte) (0xFF & b))); } builder.append("}"); return builder.toString(); } private  ByteUtils(); static byte[] bigIntToByteArrayLeadingZeros(final BigInteger value, final int numBytes); static byte[] byteArrayLeadingZeros(byte[] valueByteArray, int numBytes); static byte[] bigIntToBytes(final BigInteger x); static byte[] longToBytes(final long x); static int bytesToInt(final byte[] bytes); static byte[] intToBytes(final int x); static byte[] shortToBytes(final short x); static int isEqualConstantTime(final int b, final int c); static int isNegativeConstantTime(final int b); static String toString(final byte[] bytes);  }### Answer:
@Test public void toStringCreatesCorrectRepresentationForEmptyBytes() { final String result = ByteUtils.toString(new byte[] {}); MatcherAssert.assertThat(result, IsEqual.equalTo("{ }")); }
@Test public void toStringCreatesCorrectRepresentationForNonEmptyBytes() { final String result = ByteUtils.toString(new byte[] {0x12, (byte) 0x8A, 0x00, 0x07}); MatcherAssert.assertThat(result, IsEqual.equalTo("{ 12 8A 00 07 }")); }