### Question:
HadoopClientFactory { @SuppressWarnings("ResultOfMethodCallIgnored") public FileSystem createFileSystem(UserGroupInformation ugi, final URI uri, final Configuration conf) throws FalconException { validateInputs(ugi, uri, conf); try { final String proxyUserName = ugi.getShortUserName(); if (proxyUserName.equals(UserGroupInformation.getLoginUser().getShortUserName())) { LOG.trace("Creating FS for the login user {}, impersonation not required", proxyUserName); return FileSystem.get(uri, conf); } LOG.trace("Creating FS impersonating user {}", proxyUserName); return ugi.doAs(new PrivilegedExceptionAction<FileSystem>() { public FileSystem run() throws Exception { return FileSystem.get(uri, conf); } }); } catch (InterruptedException | IOException ex) { throw new FalconException("Exception creating FileSystem:" + ex.getMessage(), ex); } } private  HadoopClientFactory(); static HadoopClientFactory get(); FileSystem createFalconFileSystem(final URI uri); FileSystem createFalconFileSystem(final Configuration conf); FileSystem createProxiedFileSystem(final Configuration conf); DistributedFileSystem createDistributedProxiedFileSystem(final Configuration conf); FileSystem createProxiedFileSystem(final URI uri); FileSystem createProxiedFileSystem(final URI uri,
                                              final Configuration conf); @SuppressWarnings("ResultOfMethodCallIgnored") FileSystem createFileSystem(UserGroupInformation ugi, final URI uri,
                                       final Configuration conf); @SuppressWarnings("ResultOfMethodCallIgnored") DistributedFileSystem createDistributedFileSystem(UserGroupInformation ugi, final URI uri,
                                                             final Configuration conf); void validateJobClient(String executeUrl, String rmPrincipal); static FsPermission getDirDefaultPermission(Configuration conf); static FsPermission getFileDefaultPermission(Configuration conf); static FsPermission getDirDefault(); static FsPermission getFileDefault(); static void mkdirsWithDefaultPerms(FileSystem fs, Path path); static void mkdirs(FileSystem fs, Path path,
                              FsPermission permission); static final String FS_DEFAULT_NAME_KEY; static final String MR_JT_ADDRESS_KEY; static final String YARN_RM_ADDRESS_KEY; static final FsPermission READ_EXECUTE_PERMISSION; static final FsPermission ALL_PERMISSION; static final FsPermission READ_ONLY_PERMISSION; }### Answer:
@Test public void testCreateFileSystem() throws Exception { Configuration conf = embeddedCluster.getConf(); UserGroupInformation.setConfiguration(conf); UserGroupInformation realUser = UserGroupInformation.createUserForTesting( FalconTestUtil.TEST_USER_2, new String[]{"testgroup"}); UserGroupInformation.createProxyUserForTesting("proxyuser", realUser, new String[]{"proxygroup"}); URI uri = new URI(conf.get(HadoopClientFactory.FS_DEFAULT_NAME_KEY)); Assert.assertNotNull(uri); FileSystem fs = HadoopClientFactory.get().createFileSystem(realUser, uri, conf); Assert.assertNotNull(fs); }