@Test public void exception_is_not_thrown_on_unreserved_name() { ReservedDocumentTypeNameValidator validator = new ReservedDocumentTypeNameValidator(); validator.validate(asDocTypeMapping(Collections.singletonList("foo"))); }
public void validate(Map<String, NewDocumentType> documentDefinitions) { List<String> conflictingNames = documentDefinitions.keySet().stream() .filter(this::isReservedName) .collect(Collectors.toList()); if (!conflictingNames.isEmpty()) { throw new IllegalArgumentException(makeReservedNameMessage(conflictingNames)); } }
ReservedDocumentTypeNameValidator { public void validate(Map<String, NewDocumentType> documentDefinitions) { List<String> conflictingNames = documentDefinitions.keySet().stream() .filter(this::isReservedName) .collect(Collectors.toList()); if (!conflictingNames.isEmpty()) { throw new IllegalArgumentException(makeReservedNameMessage(conflictingNames)); } } }
ReservedDocumentTypeNameValidator { public void validate(Map<String, NewDocumentType> documentDefinitions) { List<String> conflictingNames = documentDefinitions.keySet().stream() .filter(this::isReservedName) .collect(Collectors.toList()); if (!conflictingNames.isEmpty()) { throw new IllegalArgumentException(makeReservedNameMessage(conflictingNames)); } }  }
ReservedDocumentTypeNameValidator { public void validate(Map<String, NewDocumentType> documentDefinitions) { List<String> conflictingNames = documentDefinitions.keySet().stream() .filter(this::isReservedName) .collect(Collectors.toList()); if (!conflictingNames.isEmpty()) { throw new IllegalArgumentException(makeReservedNameMessage(conflictingNames)); } }  void validate(Map<String, NewDocumentType> documentDefinitions); }
ReservedDocumentTypeNameValidator { public void validate(Map<String, NewDocumentType> documentDefinitions) { List<String> conflictingNames = documentDefinitions.keySet().stream() .filter(this::isReservedName) .collect(Collectors.toList()); if (!conflictingNames.isEmpty()) { throw new IllegalArgumentException(makeReservedNameMessage(conflictingNames)); } }  void validate(Map<String, NewDocumentType> documentDefinitions); static final List<String> ORDERED_RESERVED_NAMES; static final Set<String> RESERVED_NAMES; }