### Question:
InstanceOfValidator implements ConstraintValidator<InstanceOf, ClientExpression>, ValidationErrorDescriptorBuilder { @Override public boolean isValid(ClientExpression value, ConstraintValidatorContext context) { if (value == null) return true; if (acceptedClasses != null && !acceptedClasses.isEmpty()) { for (Class clazz : acceptedClasses) { if (clazz.isInstance(value)) { return true; } } } return false; }  @Override void initialize(InstanceOf constraintAnnotation); @Override boolean isValid(ClientExpression value, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void isValid_nullInput_expectedTrue() { assertTrue(validator.isValid(null, constraintValidatorContextMock)); }
@Test public void isValid_expectedTrue() { validator.acceptedClasses.add(ClientVariable.class); assertTrue(validator.isValid(new ClientVariable("testVariable"), constraintValidatorContextMock)); }
@Test public void isValid_expectedFalse() { validator.acceptedClasses.add(ClientVariable.class); assertFalse(validator.isValid(new ClientString("testString"), constraintValidatorContextMock)); }