Base64 implements ICodec { @Override public byte[] decode(@Nonnull final byte[] message) throws DecodingException { try { return base64Decoder.decode(message); } catch (Exception e) { throw new DecodingException("Base64 decoding has been failed because: " + e.getMessage(), e); } } private  Base64(); static Base64 create(); @Override byte[] encode(@Nonnull final byte[] message); @Override byte[] decode(@Nonnull final byte[] message);  }
@Test public void decodeBase64Test() throws DecodingException { byte[] base64DecodeResult = base64.decode(BASE64_MSG); assertTrue(Arrays.equals(base64DecodeResult, SOURCE_MSG)); }