MountInfo implements Mount { @Override public boolean isUnder(String path) { path = SANITIZE_PATH.apply(path); String nextPath = includedPaths.higher(path); return nextPath != null && isAncestor(path, nextPath); } MountInfo(String name, boolean readOnly, List<String> pathsSupportingFragments,
              List<String> includedPaths); @Override boolean isUnder(String path); @Override boolean isDirectlyUnder(String path); @Override boolean isMounted(String path); @Override String getName(); @Override boolean isReadOnly(); @Override boolean isDefault(); @Override boolean isSupportFragment(String path); @Override boolean isSupportFragmentUnder(String path); @Override String getPathFragmentName(); Set<String> getPathsSupportingFragments(); Set<String> getIncludedPaths(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testIsUnder() { MountInfo md = new MountInfo("foo", false, Collections.<String>emptyList(), of("/apps", "/etc/config", "/content/my/site", "/var")); assertTrue(md.isUnder("/etc")); assertTrue(md.isUnder("/content")); assertTrue(md.isUnder("/content/my")); assertFalse(md.isUnder("/content/my/site")); assertFalse(md.isUnder("/libs")); assertFalse(md.isUnder("/tmp")); }