AlgorithmEncryptor implements Encryptor, java.io.Serializable { @Override public String encrypt(final String data) { LOGGER.debug("encrypting data"); requireNonNull(data, "data must not be null"); String encryptedData = encryptor.encrypt(data); LOGGER.debug("encrypted data"); return encryptedData; } @Inject  AlgorithmEncryptor(@Named("crypto.key") final String key,
                              @Named("crypto.algorithm") final String algorithm,
                              @Named("crypto.poolsize") final int poolSize); @Override String encrypt(final String data); @Override String decrypt(final String encryptedData);  }
@Test(expected = NullPointerException.class) public void testEncryptNull() { algorithmEncryptor.encrypt(null); }
@Test public void testEncrypt() { assertThat(algorithmEncryptor.encrypt(testMessage), is(not(testMessage))); }