String attributeName = "string";
PropertyIsEqualTo filter = fac.equals(fac.property(attributeName), fac.literal("Value"));
SimpleFeatureTypeBuilder builder=new SimpleFeatureTypeBuilder();
builder.setName("test");
builder.restriction(filter).add(attributeName, String.class);
SimpleFeatureType featureType = builder.buildFeatureType();
AttributeValidator validator=new AttributeValidator(featureType.getDescriptor(attributeName), featureType);