SimpleMountInfoProvider implements MountInfoProvider { @Override public Collection<Mount> getMountsPlacedUnder(String path) { Collection<Mount> mounts = Lists.newArrayList(); for ( Mount mount : this.mounts.values()) { if ( mount.isUnder(path) ) { mounts.add(mount); } } return mounts; } SimpleMountInfoProvider(List<Mount> mountInfos); @Override Mount getMountByPath(String path); @Override Collection<Mount> getNonDefaultMounts(); @Override Mount getMountByName(String name); @Override boolean hasNonDefaultMounts(); @Override Collection<Mount> getMountsPlacedUnder(String path); @Override Collection<Mount> getMountsPlacedDirectlyUnder(String path); @Override Mount getDefaultMount();  }
@Test public void mountsPlacedUnder() { MountInfoProvider mip = Mounts.newBuilder() .mount("first", "/b") .mount("second", "/d", "/b/a") .mount("third", "/h", "/b/c") .build(); Collection<Mount> mountsContainedBetweenPaths = mip.getMountsPlacedUnder("/b"); assertEquals(2, mountsContainedBetweenPaths.size()); }