CryptoData { static CryptoData fromBytes(EncodingProvider encodingProviders, byte[] messageBytes, byte[] ivBytes) { return new CryptoData(encodingProviders, messageBytes, ivBytes); } private  CryptoData(EncodingProvider encodingProvider, byte[] messageBytes, byte[] ivBytes); private  CryptoData(EncodingProvider encodingProvider, String message, String iv); @Override String toString();  }
@Test public void fromBytes() throws Exception { CryptoData cryptoData = CryptoData.fromBytes(encodingProvider, TEST_MESSAGE.getBytes(), TEST_IV.getBytes()); assertTrue(Arrays.equals(TEST_MESSAGE.getBytes(), cryptoData.getMessage())); assertTrue(Arrays.equals(TEST_IV.getBytes(), cryptoData.getIv())); assertTrue(cryptoData.toString().contains(CryptoData.SEPARATOR)); }