ObjectDomain extends AbstractValueDomain<Map<String,DataValue<?>>> { public void setPropertyDomains( Map<String,ValueDomain<?>> propertyDomains) { propertyDomains_ = Optional.ofNullable( propertyDomains) .orElse( new LinkedHashMap<String,ValueDomain<?>>()); propertyDomains_.keySet().stream() .filter( name -> !getCharacters().allowed( name)) .findFirst() .ifPresent( name -> { throw new ValueDomainException( String.format( "Property name='%s' is not allowed by %s", name, getCharacters())); }); } ObjectDomain();  ObjectDomain( Characters chars);  ObjectDomain( ValueDomain<Integer> additionalPropertyCount, ValueDomain<?> additionalPropertyValues);  ObjectDomain( ValueDomain<Integer> additionalPropertyCount, ValueDomain<?> additionalPropertyValues, Characters chars); Characters getCharacters(); void setPropertyDomains( Map<String,ValueDomain<?>> propertyDomains); Map<String,ValueDomain<?>> getPropertyDomains(); void setAdditionalPropertyCount( ValueDomain<Integer> count); void setAdditionalPropertyValues( ValueDomain<?> additionalPropertyValues); ValueDomain<?> getAdditionalPropertyValues(); ValueDomain<Integer> getAdditionalPropertyCount(); void setAdditionalPropertyNames( AbstractStringDomain domain); AbstractStringDomain getAdditionalPropertyNames(); Stream<DataValue<Map<String,DataValue<?>>>> values( ResolverContext context); boolean contains( Map<String,DataValue<?>> value); Type[] getTypes(); String toString();  }
@Test public void whenInvalidPropertyName() { ObjectDomain domain = new ObjectDomain( Characters.TOKEN); Map<String,ValueDomain<?>> properties = new MapBuilder<String,ValueDomain<?>>().put( "<id>", new AsciiStringDomain( 4)).build(); expectFailure( ValueDomainException.class) .when( () -> domain.setPropertyDomains( properties)); }