### Question:
DependencyValidation { public void validate(String property, Set<String> dependentProperties) { validateNotDependsOnSelf(property, dependentProperties); validateDependsOnExistingProperties(property, dependentProperties); } DependencyValidation(Set<String> existingPropertyNames); void validate(String property, Set<String> dependentProperties);  }### Answer:
@Test(expected = RuntimeException.class) public void givenDependingOnSelf_thenThrowException() { validation.validate(PROPERTY_NAME, Sets.newHashSet("property1", PROPERTY_NAME, "property2")); }
@Test(expected = RuntimeException.class) public void whenCreateWithSomeNonExistingDependentProperties_thenThrowException() { validation.validate(PROPERTY_NAME, Sets.newHashSet("property1", "nonExistingProperty", "property2")); }
@Test public void givenValidDependentProperties_thenSuccessful() { validation.validate(PROPERTY_NAME, Sets.newHashSet("property1", "property2")); }