public static boolean isPathPresent(MaskTree filter, PathSpec path)
  {
    return !getPresentPaths(filter, Collections.singleton(path)).isEmpty();
  }
@Test
  public void testPositiveSinglePath()
  {
    final MaskTree filter = new MaskTree();
    filter.addOperation(new PathSpec("foo", "bar", "baz"), MaskOperation.POSITIVE_MASK_OP);

    // ancestor nodes are considered present if matched in path
    Assert.assertTrue(ProjectionUtil.isPathPresent(filter, new PathSpec("foo")));
    Assert.assertTrue(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "bar")));

    Assert.assertTrue(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "bar", "baz")));

    // all matched child nodes are considered present
    Assert.assertTrue(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "bar", "baz", "xyz")));
    Assert.assertTrue(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "bar", "baz", "abc", "xyz")));

    Assert.assertFalse(ProjectionUtil.isPathPresent(filter, new PathSpec("xyz")));
    Assert.assertFalse(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "baz")));
    Assert.assertFalse(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "xyz")));
    Assert.assertFalse(ProjectionUtil.isPathPresent(filter, new PathSpec("foo", "bar", "xyz")));
  }