### Question:
CheckParametersExpressionContainerValidator implements ConstraintValidator<CheckParametersExpressionContainer, Map<String, ClientExpressionContainer>>, ValidationErrorDescriptorBuilder { @Override public boolean isValid(Map<String, ClientExpressionContainer> expressionMap, ConstraintValidatorContext context) { if (expressionMap == null) return true; for (Map.Entry<String, ClientExpressionContainer> entry : expressionMap.entrySet()) { ClientExpressionContainer expressionContainer = entry.getValue(); if (expressionContainer == null) { return false; } else if (expressionContainer.getString() != null) { continue; } ClientExpression expression = expressionContainer.getObject(); if (expression == null || !acceptedExpressions.contains(expression.getClass())){ return false; } } return true; }  @Override void initialize(CheckParametersExpressionContainer constraintAnnotation); @Override boolean isValid(Map<String, ClientExpressionContainer> expressionMap, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void isValid_expressionMapIsNull_returnTrue() { assertTrue(checkParametersExpressionContainerValidator.isValid(null, null)); }
@Test public void isValid_expressionMapIsEmpty_returnTrue() { assertTrue(checkParametersExpressionContainerValidator.isValid(new HashMap<String, ClientExpressionContainer>(), null)); }
@Test public void isValid_expressionValueIsNull_returnFalse() { HashMap<String, ClientExpressionContainer> expressionMap = new HashMap<String, ClientExpressionContainer>() {{ put("test", null); }}; assertFalse(checkParametersExpressionContainerValidator.isValid(expressionMap, null)); }
@Test public void isValid_emptyClientExpressionContainer_returnFalse() { HashMap<String, ClientExpressionContainer> expressionMap = new HashMap<String, ClientExpressionContainer>() {{ put("test", new ClientExpressionContainer()); }}; assertFalse(checkParametersExpressionContainerValidator.isValid(expressionMap, null)); }
@Test public void isValid_ClientExpressionContainerWithString_returnTrue() { HashMap<String, ClientExpressionContainer> expressionMap = new HashMap<String, ClientExpressionContainer>() {{ put("test", new ClientExpressionContainer().setString("test expression")); }}; assertTrue(checkParametersExpressionContainerValidator.isValid(expressionMap, null)); }
@Test public void isValid_ClientExpressionContainerWithInteger_returnTrue() { HashMap<String, ClientExpressionContainer> expressionMap = new HashMap<String, ClientExpressionContainer>() {{ put("test", new ClientExpressionContainer().setObject(new ClientNumber())); }}; assertTrue(checkParametersExpressionContainerValidator.isValid(expressionMap, null)); }
@Test public void isValid_ClientExpressionContainerWithNonValidFunction_returnFalse() { HashMap<String, ClientExpressionContainer> expressionMap = new HashMap<String, ClientExpressionContainer>() {{ put("test", new ClientExpressionContainer().setObject(new ClientOr())); }}; assertFalse(checkParametersExpressionContainerValidator.isValid(expressionMap, null)); }
@Test public void isValid_ClientExpressionContainerMultipleExpressionsWithOneInvalid_returnFalse() { HashMap<String, ClientExpressionContainer> expressionMap = new LinkedHashMap<String, ClientExpressionContainer>(); expressionMap.put("firstValid", new ClientExpressionContainer().setObject(new ClientNumber(10))); expressionMap.put("secondValid", new ClientExpressionContainer().setString("integer(10)")); expressionMap.put("thirdInvalid", new ClientExpressionContainer()); assertFalse(checkParametersExpressionContainerValidator.isValid(expressionMap, null)); }