IfPathHasValueValidation implements Validation { @Override public Set<String> getKnownPaths() { Set<String> knownPaths = Sets.newHashSet(ifPath); knownPaths.addAll(thenValidation.getKnownPaths()); return Sets.newHashSet(knownPaths); } IfPathHasValueValidation(String ifPath, Object hasValue, Validation thenValidation); @Override ValidationResult validate(Config config); @Override String toString(); @Override Set<String> getKnownPaths();  }
@Test public void testKnownPaths() { Validation v = new IfPathHasValueValidation("hello", 2, Validations.single().allowedValues("world", 1, 2, 3)); assertEquals(Sets.newHashSet("hello", "world"), v.getKnownPaths()); }