@Test
public void testHasDanglingAncestors() throws IOException, ConfigurationException {

    DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
    try (InputStream input = this.getClass().getResourceAsStream("/test-filter.xml")) {
        filter.load(input);
    }
    validator = new AdvancedFilterValidator(
            factory,
            ValidationMessageSeverity.WARN,
            AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
            ValidationMessageSeverity.ERROR,
            ValidationMessageSeverity.ERROR,
            false,
            dependenciesMetaInfo,
            filter, // this is per test
            validRoots);
    Assert.assertNull(validator.getDanglingAncestorNodePath("/var/acs-commons/on-deploy-scripts-status/README.txt", filter));
    Assert.assertEquals("/var/acs-commons/mcp", validator.getDanglingAncestorNodePath("/var/acs-commons/mcp/rep:policy", filter));
    // https://issues.apache.org/jira/browse/JCRVLT-378
    Assert.assertNull(validator.getDanglingAncestorNodePath("/var/acs-commons/on-deploy-scripts-status/rep:policy", filter));
    // make sure it is returned only once
    Assert.assertNull(validator.getDanglingAncestorNodePath("/var/acs-commons/mcp/rep:policy/allow", filter));
}