### Question:
ChRootedFs extends AbstractFileSystem { @Override public boolean delete(final Path f, final boolean recursive) throws IOException, UnresolvedLinkException { return myFs.delete(fullPath(f), recursive); } ChRootedFs(final AbstractFileSystem fs, final Path theRoot); @Override URI getUri(); String stripOutRoot(final Path p); @Override Path getHomeDirectory(); @Override Path getInitialWorkingDirectory(); Path getResolvedQualifiedPath(final Path f); @Override FSDataOutputStream createInternal(final Path f,
      final EnumSet<CreateFlag> flag, final FsPermission absolutePermission,
      final int bufferSize, final short replication, final long blockSize,
      final Progressable progress, final int bytesPerChecksum,
      final boolean createParent); @Override boolean delete(final Path f, final boolean recursive); @Override BlockLocation[] getFileBlockLocations(final Path f, final long start,
      final long len); @Override FileChecksum getFileChecksum(final Path f); @Override FileStatus getFileStatus(final Path f); @Override FileStatus getFileLinkStatus(final Path f); @Override FsStatus getFsStatus(); @Override FsServerDefaults getServerDefaults(); @Override int getUriDefaultPort(); @Override FileStatus[] listStatus(final Path f); @Override void mkdir(final Path dir, final FsPermission permission,
      final boolean createParent); @Override FSDataInputStream open(final Path f, final int bufferSize); @Override void renameInternal(final Path src, final Path dst); @Override void renameInternal(final Path src, final Path dst, 
      final boolean overwrite); @Override void setOwner(final Path f, final String username,
      final String groupname); @Override void setPermission(final Path f, final FsPermission permission); @Override boolean setReplication(final Path f, final short replication); @Override void setTimes(final Path f, final long mtime, final long atime); @Override void setVerifyChecksum(final boolean verifyChecksum); @Override boolean supportsSymlinks(); @Override void createSymlink(final Path target, final Path link,
      final boolean createParent); @Override Path getLinkTarget(final Path f); @Override List<Token<?>> getDelegationTokens(String renewer);  }### Answer:
@Test public void testCreateDelete() throws IOException { FileContextTestHelper.createFileNonRecursive(fc, "/foo"); Assert.assertTrue(isFile(fc, new Path("/foo"))); Assert.assertTrue(isFile(fcTarget, new Path(chrootedTo, "foo"))); FileContextTestHelper.createFile(fc, "/newDir/foo"); Assert.assertTrue(isFile(fc, new Path("/newDir/foo"))); Assert.assertTrue(isFile(fcTarget, new Path(chrootedTo,"newDir/foo"))); Assert.assertTrue(fc.delete(new Path("/newDir/foo"), false)); Assert.assertFalse(exists(fc, new Path("/newDir/foo"))); Assert.assertFalse(exists(fcTarget, new Path(chrootedTo,"newDir/foo"))); FileContextTestHelper.createFile(fc, "/newDir/newDir2/foo"); Assert.assertTrue(isFile(fc, new Path("/newDir/newDir2/foo"))); Assert.assertTrue(isFile(fcTarget, new Path(chrootedTo,"newDir/newDir2/foo"))); Assert.assertTrue(fc.delete(new Path("/newDir/newDir2/foo"), false)); Assert.assertFalse(exists(fc, new Path("/newDir/newDir2/foo"))); Assert.assertFalse(exists(fcTarget, new Path(chrootedTo,"newDir/newDir2/foo"))); }