@Override
    public String getReplacement(String variable) {
        try {
            return decrypt(variable);
        } catch (Exception e) {
            logger.warning("Unable to decrypt variable " + variable, e);
        }
        return null;
    }
@Test
    public void testWrongVariables() throws Exception {
        assumeDefaultAlgorithmsSupported();

        AbstractPbeReplacer replacer = createAndInitReplacer("test", new Properties());

        assertNull(replacer.getReplacement(null));
        assertNull(replacer.getReplacement("WronglyFormatted"));
        assertNull(replacer.getReplacement("aSalt:1:EncryptedValue"));
        // following incorrect value was generated using replacer.encrypt("test", 777).replace(":777:", ":1:");
        assertNull("Null value expected as javax.crypto.BadPaddingException should be thrown in the AbstractPbeReplacer",
                replacer.getReplacement("IVJXCMo0XBE=:1:NnZjBhX7sB/IT0sTFZ2eIA=="));
    }