CryptoData { static CryptoData fromString(EncodingProvider encodingProvider, String input) throws CryptoDataException { verifyCryptoDataString(input); String[] inputParams = input.split(SEPARATOR); return new CryptoData(encodingProvider, inputParams[0], inputParams[1]); } private  CryptoData(EncodingProvider encodingProvider, byte[] messageBytes, byte[] ivBytes); private  CryptoData(EncodingProvider encodingProvider, String message, String iv); @Override String toString();  }
@Test public void fromString() throws Exception { CryptoData cryptoData = CryptoData.fromString(encodingProvider, INPUT); assertTrue(Arrays.equals(TEST_MESSAGE.getBytes(), cryptoData.getMessage())); assertTrue(Arrays.equals(TEST_IV.getBytes(), cryptoData.getIv())); assertTrue(cryptoData.toString().contains(CryptoData.SEPARATOR)); }