MonetaryAmountAcceptedValidator implements ConstraintValidator<CurrencyAccepted, MonetaryAmount> { @Override public boolean isValid(MonetaryAmount value, ConstraintValidatorContext context) { if (value == null) { return true; } return containsCurrency(value.getCurrency()); }  @Override void initialize(CurrencyAccepted constraintAnnotation); @Override boolean isValid(MonetaryAmount value,
                           ConstraintValidatorContext context);  }
@Test public void shouldReturnsTrueWhenCurrencyIsNull() { Assertions.assertTrue(monetaryAmountValidator.isValid(null, context)); }