Encoding { @NonNull public byte[] fromBase64ToBytes(@NonNull String value) { ESLog.v("%s=>fromBase64ToBytes(%s)", getClass().getSimpleName(), value); return Base64.decode(value.getBytes(SSCharset.CHARSET), Base64.NO_WRAP); }  @NonNull String toBase64(@NonNull String value); @NonNull String fromBase64ToString(@NonNull String value); @NonNull String toBase64(@NonNull byte[] value); @NonNull byte[] fromBase64ToBytes(@NonNull String value);  }
@Test public void fromBase64ToBytes_ShouldDecodeToBase64String() { byte[] expectedBytes = TEST_VALUE.getBytes(SSCharset.CHARSET); PowerMockito.when(Base64.decode(TEST_VALUE_BASE64.getBytes(SSCharset.CHARSET), Base64.NO_WRAP)) .thenReturn(expectedBytes); Assert.assertTrue(Arrays.equals(expectedBytes, encoding.fromBase64ToBytes(TEST_VALUE_BASE64))); }