### Question:
IntegerPropertyDefinition extends PropertyDefinition<Integer> { @Override public void validateValue(Integer value) { Reject.ifNull(value); if (!allowUnlimited && value < lowerLimit) { throw PropertyException.illegalPropertyValueException(this, value); } else if (value >= 0 && value < lowerLimit) { throw PropertyException.illegalPropertyValueException(this, value); } if (upperLimit != null && value > upperLimit) { throw PropertyException.illegalPropertyValueException(this, value); } } private  IntegerPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName,
        EnumSet<PropertyOption> options, AdministratorAction adminAction,
        DefaultBehaviorProvider<Integer> defaultBehavior, int lowerLimit, Integer upperLimit, boolean allowUnlimited); static Builder createBuilder(AbstractManagedObjectDefinition<?, ?> d, String propertyName); int getLowerLimit(); Integer getUpperLimit(); LocalizableMessage getUnitSynopsis(); LocalizableMessage getUnitSynopsis(Locale locale); boolean isAllowUnlimited(); @Override void validateValue(Integer value); @Override String encodeValue(Integer value); @Override Integer decodeValue(String value); @Override R accept(PropertyDefinitionVisitor<R, P> v, P p); @Override R accept(PropertyValueVisitor<R, P> v, Integer value, P p); @Override void toString(StringBuilder builder); @Override int compare(Integer o1, Integer o2);  }### Answer:
@Test(expectedExceptions = PropertyException.class) public void testIsAllowUnlimitedInteger() { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setAllowUnlimited(false); IntegerPropertyDefinition propertyDef = buildTestDefinition(builder); propertyDef.validateValue(-1); }
@Test(dataProvider = "validateValueData") public void testValidateValue(Integer low, Integer high, boolean allowUnlimited, Integer valueToValidate) { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setLowerLimit(low); builder.setUpperLimit(high); builder.setAllowUnlimited(allowUnlimited); IntegerPropertyDefinition propertyDef = buildTestDefinition(builder); propertyDef.validateValue(valueToValidate); }
@Test(dataProvider = "illegalValidateValueData", expectedExceptions = { AssertionError.class, NullPointerException.class, PropertyException.class }) public void testValidateValueIllegal(Integer low, Integer high, boolean allowUnlimited, Integer value) { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setLowerLimit(low); builder.setUpperLimit(high); builder.setAllowUnlimited(allowUnlimited); IntegerPropertyDefinition propertyDef = buildTestDefinition(builder); propertyDef.validateValue(value); }