### Question:
WCHAREncoder { public String byteArrayToEncode(byte[] toEncodeByteArray) { Preconditions.checkNotNull(toEncodeByteArray); return new String(toEncodeByteArray, Charsets.UTF_16LE); } @Inject @VisibleForTesting  WCHAREncoder(); byte[] toByteArray(String toEncodeString); String byteArrayToEncode(byte[] toEncodeByteArray);  }### Answer:
@Test(expected=NullPointerException.class) public void testDecodeNull() { new WCHAREncoder().byteArrayToEncode(null); }
@Test public void testDecodeEmpty() { String string = new WCHAREncoder().byteArrayToEncode(new byte[0]); Assertions.assertThat(string).isEmpty(); }
@Test public void testDecodeRegularByteArray() { String string = new WCHAREncoder().byteArrayToEncode(new byte[]{104, 0, 101, 0, 108, 0, 108, 0, 111, 0}); Assertions.assertThat(string).isEqualTo("hello"); }