MountInfo implements Mount { @Override public boolean isDirectlyUnder(String path) { path = SANITIZE_PATH.apply(path); String nextPath = includedPaths.higher(path); return nextPath != null && path.equals(getParentPath(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 testIsDirectlyUnder() { MountInfo md = new MountInfo("foo", false, Collections.<String>emptyList(), of("/apps", "/etc/my/config", "/var")); assertFalse(md.isDirectlyUnder("/etc")); assertTrue(md.isDirectlyUnder("/etc/my")); assertFalse(md.isDirectlyUnder("/etc/my/config")); assertFalse(md.isDirectlyUnder("/libs")); }