### Question:
ApiVersionValidationFactory { public ApiVersionValidation createValidationAccepting(String ...acceptedVersions) { return new ApiVersionValidationImpl(acceptedVersions); }  ApiVersionValidation createValidationAccepting(String ...acceptedVersions);  }### Answer:
@Test public void returns_validation_suitable_for_nothing() { ApiVersionValidation validation = factoryToTest.createValidationAccepting(); assertFalse(validation.validate("1.0").isValid()); assertFalse(validation.validate("1.1").isValid()); }
@Test public void returns_validation_suitable_for_one_version() { ApiVersionValidation validation = factoryToTest.createValidationAccepting("1.1"); assertTrue(validation.validate("1.1").isValid()); assertFalse(validation.validate("1.0").isValid()); }
@Test public void returns_validation_suitable_for_two_versions() { ApiVersionValidation validation = factoryToTest.createValidationAccepting("1.0", "1.1"); assertTrue(validation.validate("1.0").isValid()); assertTrue(validation.validate("1.1").isValid()); assertFalse(validation.validate("0.1").isValid()); }