SimpleMountInfoProvider implements MountInfoProvider { @Override public Mount getMountByName(String name) { return mounts.get(name); } 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 readOnlyMounting() throws Exception{ MountInfoProvider mip = Mounts.newBuilder() .mount("foo", "/a", "/b") .readOnlyMount("bar", "/x", "/y") .build(); assertTrue(mip.getMountByName("bar").isReadOnly()); assertFalse(mip.getMountByName("foo").isReadOnly()); }