### Question:
ChRootedFileSystem extends FilterFileSystem { @Override public Path resolvePath(final Path p) throws IOException { return super.resolvePath(fullPath(p)); } ChRootedFileSystem(final URI uri, Configuration conf); void initialize(final URI name, final Configuration conf); @Override URI getUri(); Path getResolvedQualifiedPath(final Path f); @Override Path getWorkingDirectory(); @Override void setWorkingDirectory(final Path new_dir); @Override FSDataOutputStream create(final Path f, final FsPermission permission,
      final boolean overwrite, final int bufferSize, final short replication,
      final long blockSize, final Progressable progress); @Override @Deprecated FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
      EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize,
      Progressable progress); @Override boolean delete(final Path f, final boolean recursive); @Override @SuppressWarnings("deprecation") boolean delete(Path f); @Override BlockLocation[] getFileBlockLocations(final FileStatus fs, final long start,
      final long len); @Override FileChecksum getFileChecksum(final Path f); @Override FileStatus getFileStatus(final Path f); @Override FsStatus getStatus(Path p); @Override FileStatus[] listStatus(final Path f); @Override boolean mkdirs(final Path f, final FsPermission permission); @Override FSDataInputStream open(final Path f, final int bufferSize); @Override FSDataOutputStream append(final Path f, final int bufferSize,
      final Progressable progress); @Override boolean rename(final Path src, final Path dst); @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 Path resolvePath(final Path p); @Override ContentSummary getContentSummary(Path f); @Override long getDefaultBlockSize(); @Override long getDefaultBlockSize(Path f); @Override short getDefaultReplication(); @Override short getDefaultReplication(Path f); @Override FsServerDefaults getServerDefaults(); @Override FsServerDefaults getServerDefaults(Path f);  }### Answer:
@Test public void testResolvePath() throws IOException { Assert.assertEquals(chrootedTo, fSys.resolvePath(new Path("/"))); FileSystemTestHelper.createFile(fSys, "/foo"); Assert.assertEquals(new Path(chrootedTo, "foo"), fSys.resolvePath(new Path("/foo"))); }
@Test(expected=FileNotFoundException.class) public void testResolvePathNonExisting() throws IOException { fSys.resolvePath(new Path("/nonExisting")); }