### Question:
BulldogUtil { public static String bytesToString(byte[] bytes, String encoding) { if(bytes == null) { throw new IllegalArgumentException("bytes may not be null in string conversion"); } if(bytes.length == 0) { return null; } try { return new String(bytes, encoding); } catch (Exception e) { throw new IllegalArgumentException("Unknown encoding"); } }  static void sleepMs(int ms); static void sleepNs(int ns); static String bytesToString(byte[] bytes, String encoding); static String bytesToString(byte[] bytes); @SuppressWarnings("resource") static String convertStreamToString(java.io.InputStream is); static String readFileAsString(String path); static boolean isStringNumeric(String str); static final int getUnsignedByte(byte b);  }### Answer:
@Test public void testBytesToString() throws UnsupportedEncodingException { String string = BulldogUtil.bytesToString("Hello World".getBytes("ASCII")); TestCase.assertEquals("Hello World", string); string = BulldogUtil.bytesToString("Hello World".getBytes()); TestCase.assertEquals("Hello World", string); string = BulldogUtil.bytesToString(new byte[] {}); TestCase.assertNull(string); try { string = BulldogUtil.bytesToString(null); TestCase.fail(); } catch(IllegalArgumentException ex) { } try { string = BulldogUtil.bytesToString("Hello World".getBytes("ASCII"), "NON_EXISTENT_ENCODING"); } catch(IllegalArgumentException ex) { TestCase.assertEquals("Unknown encoding", ex.getMessage()); } }