MountInfo implements Mount { @Override public boolean isSupportFragment(String path) { String subject = SANITIZE_PATH.apply(path); return pathsSupportingFragments.stream() .map(pattern -> FragmentMatcher.startsWith(pattern, subject)) .anyMatch(FULL_MATCH::equals); } 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 testSupportFragment() { MountInfo md = new MountInfo("foo", false, of("/apps", "/libs/*/site", "/content/*$", "/var$"), Collections.emptyList()); assertFalse(md.isSupportFragment("/")); assertTrue(md.isSupportFragment("/apps")); assertTrue(md.isSupportFragment("/apps/acme")); assertFalse(md.isSupportFragment("/libs")); assertFalse(md.isSupportFragment("/libs/acme")); assertTrue(md.isSupportFragment("/libs/acme/site")); assertTrue(md.isSupportFragment("/libs/acme/site/abc")); assertFalse(md.isSupportFragment("/content")); assertTrue(md.isSupportFragment("/content/site")); assertFalse(md.isSupportFragment("/content/site/abc")); assertTrue(md.isSupportFragment("/var")); assertFalse(md.isSupportFragment("/var/abc")); }