### Question:
StringPropertyDefinition extends PropertyDefinition<String> { @Override public void validateValue(String value) throws PropertyException { ifNull(value); if (pattern != null) { Matcher matcher = pattern.matcher(value); if (!matcher.matches()) { throw PropertyException.illegalPropertyValueException(this, value); } } } private  StringPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d,
      String propertyName, EnumSet<PropertyOption> options,
      AdministratorAction adminAction,
      DefaultBehaviorProvider<String> defaultBehavior,
      boolean isCaseInsensitive, Pattern pattern, String patternUsage); static Builder createBuilder(AbstractManagedObjectDefinition<?, ?> d,
      String propertyName); @Override R accept(PropertyDefinitionVisitor<R, P> v, P p); @Override R accept(PropertyValueVisitor<R, P> v, String value, P p); @Override String decodeValue(String value); Pattern getPattern(); LocalizableMessage getPatternSynopsis(); LocalizableMessage getPatternSynopsis(Locale locale); String getPatternUsage(); boolean isCaseInsensitive(); @Override String normalizeValue(String value); @Override void validateValue(String value);  }### Answer:
@Test public void testValidateValue1() { StringPropertyDefinition d = getDefinition(true, null); d.validateValue("abc"); }
@Test public void testValidateValue2() { StringPropertyDefinition d = getDefinition(true, "^[a-z]+$"); d.validateValue("abc"); }
@Test(expectedExceptions = PropertyException.class) public void testValidateValue3() { StringPropertyDefinition d = getDefinition(true, "^[a-z]+$"); d.validateValue("abc123"); }