### Question:
ValidateUtils { @NonNull static List<String> validateCipherParams(@NonNull Mode mode, @Nullable String key, @Nullable String value) { List<String> errors = new ArrayList<>(); if (mode != Mode.AUTHENTICATION) { if (StringUtils.isBlankOrNull(key)) { errors.add("Key is required if encryption or decryption is used!"); } if (StringUtils.isBlankOrNull(value)) { errors.add("Value is required if encryption or decryption is used!"); } } return errors; } private  ValidateUtils();   }### Answer:
@Test public void decrypt_invalid_emptyKey() { assertEquals(1, ValidateUtils.validateCipherParams(Mode.DECRYPTION, "", VALUE).size()); }
@Test public void decrypt_invalid_emptyValue() { assertEquals(1, ValidateUtils.validateCipherParams(Mode.DECRYPTION, KEY, "").size()); }
@Test public void decrypt_valid() { assertTrue(ValidateUtils.validateCipherParams(Mode.DECRYPTION, KEY, VALUE).isEmpty()); }
@Test public void encrypt_invalid_emptyKey() { assertEquals(1, ValidateUtils.validateCipherParams(Mode.ENCRYPTION, "", VALUE).size()); }
@Test public void encrypt_invalid_emptyValue() { assertEquals(1, ValidateUtils.validateCipherParams(Mode.ENCRYPTION, KEY, "").size()); }
@Test public void encrypt_valid() { assertTrue(ValidateUtils.validateCipherParams(Mode.ENCRYPTION, KEY, VALUE).isEmpty()); }