### Question:
IntegerPropertyDefinition extends PropertyDefinition<Integer> { @Override public Integer decodeValue(String value) { Reject.ifNull(value); if (allowUnlimited && UNLIMITED.equalsIgnoreCase(value.trim())) { return -1; } Integer i; try { i = Integer.valueOf(value); } catch (NumberFormatException e) { throw PropertyException.illegalPropertyValueException(this, value); } try { validateValue(i); } catch (PropertyException e) { throw PropertyException.illegalPropertyValueException(this, value); } return i; } 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 public void testIsAllowUnlimitedTrue() { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setAllowUnlimited(true); IntegerPropertyDefinition propertyDef = buildTestDefinition(builder); propertyDef.decodeValue("unlimited"); }
@Test(expectedExceptions = PropertyException.class) public void testIsAllowUnlimitedFalse() { IntegerPropertyDefinition.Builder builder = createTestBuilder(); builder.setAllowUnlimited(false); IntegerPropertyDefinition propertyDef = buildTestDefinition(builder); propertyDef.decodeValue("unlimited"); }