### Question:
FSURIHandler implements URIHandler { @Override public boolean exists(URI uri, Context context) throws URIHandlerException { try { FileSystem fs = ((FSContext) context).getFileSystem(); return fs.exists(getNormalizedPath(uri)); } catch (IOException e) { throw new HadoopAccessorException(ErrorCode.E0902, e); } }  @Override void init(Configuration conf); @Override Set<String> getSupportedSchemes(); @Override Class<? extends LauncherURIHandler> getLauncherURIHandlerClass(); @Override List<Class<?>> getClassesForLauncher(); @Override DependencyType getDependencyType(URI uri); @Override void registerForNotification(URI uri, Configuration conf, String user, String actionID); @Override boolean unregisterFromNotification(URI uri, String actionID); @Override Context getContext(URI uri, Configuration conf, String user, boolean readOnly); @Override boolean exists(URI uri, Context context); @Override boolean exists(URI uri, Configuration conf, String user); @Override String getURIWithDoneFlag(String uri, String doneFlag); @Override String getURIWithoutDoneFlag(String uri, String doneFlag); @Override void validate(String uri); @Override void destroy(); @Override void delete(URI uri, Context context); @Override void delete(URI uri, Configuration conf, String user);  }### Answer:
@Test public void testExists() throws Exception { Path path1 = new Path(getFsTestCaseDir() + "/2012/12/02/"); Path path2 = new Path(getFsTestCaseDir() + "/2012/12/12/"); getFileSystem().mkdirs(path1); URIHandler handler = uriService.getURIHandler(path1.toUri()); assertTrue(handler.exists(path1.toUri(), conf, getTestUser())); assertFalse(handler.exists(path2.toUri(), conf, getTestUser())); handler = uriService.getURIHandler(path1.toUri(), false); assertTrue(handler.exists(new URI(path1.toUri().getPath()), conf, getTestUser())); }