@Test public void validatorIsLessThanOrEqual() { when(singleProperty.getValue()).thenReturn(Integer.valueOf(10)); when(singleProperty.getLogicalName()).thenReturn("my.property"); LessOrEqualValidator<Number> validator = new LessOrEqualValidator<>(); when(singleProperty.parseLiteral(null)).thenReturn(11, 10, 9); validator.validate(singleProperty, propertyValidation); validator.validate(singleProperty, propertyValidation); verifyZeroInteractions(propertyValidation); validator.validate(singleProperty, propertyValidation); verify(propertyValidation, times(1)).addValidationError(Matchers.<ValidationError> anyObject()); }