### Question:
DefaultTagValidatorFactory implements TagValidatorFactory { @Override public List<TagValidator> create(FactoryOptions options) { List<TagValidator> validators = new ArrayList<>(); addTagDescriptionRequiredValidator(validators, options); addTagMustBeReferencedValidator(validators, options); addTagNameCaseValidator(validators, options); return Collections.unmodifiableList(validators); }  @Override List<TagValidator> create(FactoryOptions options);  }### Answer:
@Test public void create() { FactoryOptions options = new FactoryOptions(emptyMap()); List<TagValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(0); }
@Test public void create1() { FactoryOptions options = new FactoryOptions(singletonMap(TagDescriptionRequiredValidator.CONFIG_KEY, "true")); List<TagValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(1); assertThat(validators).hasOnlyElementsOfTypes( TagDescriptionRequiredValidator.class ); }
@Test public void create2() { FactoryOptions options = new FactoryOptions(singletonMap(TagDescriptionRequiredValidator.CONFIG_KEY, "false")); List<TagValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(0); }
@Test public void create3() { FactoryOptions options = new FactoryOptions(singletonMap(TagMustBeReferencedValidator.CONFIG_KEY, "true")); List<TagValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(1); assertThat(validators).hasOnlyElementsOfTypes( TagMustBeReferencedValidator.class ); }
@Test public void create4() { FactoryOptions options = new FactoryOptions(singletonMap(TagMustBeReferencedValidator.CONFIG_KEY, "false")); List<TagValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(0); }
@Test public void create5() { FactoryOptions options = new FactoryOptions(singletonMap(TagNameCaseValidator.CONFIG_KEY, "upper-camel-case")); List<TagValidator> validators = validatorFactory.create(options); assertThat(validators).hasSize(1); assertThat(validators).hasOnlyElementsOfTypes( TagNameCaseValidator.class ); }