code: static FileSystem createProxiedFileSystemUsingToken(@NonNull String userNameToProxyAs,
        @NonNull Token<?> userNameToken, URI fsURI, Configuration conf) throws IOException, InterruptedException {
      UserGroupInformation ugi =
          UserGroupInformation.createProxyUser(userNameToProxyAs, UserGroupInformation.getLoginUser());
      ugi.addToken(userNameToken);
      return ugi.doAs(new ProxiedFileSystem(fsURI, conf));
    }
docs: Create a {@link FileSystem} that can perform any operations allowed the by the specified userNameToProxyAs. The
  method first proxies as userNameToProxyAs, and then adds the specified {@link Token} to the given
  {@link UserGroupInformation} object. It then uses the {@link UserGroupInformation#doAs(PrivilegedExceptionAction)}
  method to create a {@link FileSystem}.
  
  @param userNameToProxyAs The name of the user the super user should proxy as
  @param userNameToken The {@link Token} to add to the proxied user's {@link UserGroupInformation}.
  @param fsURI The {@link URI} for the {@link FileSystem} that should be created
  @param conf The {@link Configuration} for the {@link FileSystem} that should be created
  
  @return a {@link FileSystem} that can execute commands on behalf of the specified userNameToProxyAs