### Question:
IntegerPropertyDefinition extends
    PropertyDefinition<Integer> { @Override public void validateValue(Integer value) throws PropertyException { 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 testIsAllowUnlimited3() { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setAllowUnlimited(false); IntegerPropertyDefinition spd = buildTestDefinition(builder); spd.validateValue(-1); }
@Test(dataProvider = "validateValueData") public void testValidateValue1(Integer low, Integer high, boolean allowUnlimited, Integer value) { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setLowerLimit(low); builder.setUpperLimit(high); builder.setAllowUnlimited(allowUnlimited); IntegerPropertyDefinition spd = buildTestDefinition(builder); spd.validateValue(value); }
@Test(dataProvider = "illegalValidateValueData", expectedExceptions = {AssertionError.class,NullPointerException.class,PropertyException.class}) public void testValidateValue2(Integer low, Integer high, boolean allowUnlimited, Integer value) { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setLowerLimit(low); builder.setUpperLimit(high); builder.setAllowUnlimited(allowUnlimited); IntegerPropertyDefinition spd = buildTestDefinition(builder); spd.validateValue(value); }