### Question:
CurrentUser { public static void proxy(final String aclOwner, final String aclGroup) { if (!isAuthenticated() || StringUtils.isEmpty(aclOwner)) { throw new IllegalStateException("Authentication not done or Bad user name"); } CurrentUser user = CURRENT_USER.get(); LOG.info("Authenticated user {} is proxying entity owner {}/{}", user.authenticatedUser, aclOwner, aclGroup); AUDIT.info("Authenticated user {} is proxying entity owner {}/{}", user.authenticatedUser, aclOwner, aclGroup); user.proxyUser = aclOwner; } private  CurrentUser(String authenticatedUser); static void authenticate(final String user); static void proxyDoAsUser(final String doAsUser, final String proxyHost); static void proxy(final String aclOwner, final String aclGroup); static void clear(); static boolean isAuthenticated(); static String getAuthenticatedUser(); static UserGroupInformation getAuthenticatedUGI(); static String getUser(); static UserGroupInformation createProxyUGI(String proxyUser); static UserGroupInformation getProxyUGI(); static Set<String> getGroupNames(); static String getPrimaryGroupName();  }### Answer:
@Test (expectedExceptions = IllegalStateException.class) public void testProxyWithNoAuth() throws Exception { CurrentUser.proxy(FalconTestUtil.TEST_USER_1, "falcon"); }
@Test public void testProxy() throws Exception { CurrentUser.authenticate("real"); CurrentUser.proxy(EntityBuilderTestUtil.USER, "users"); UserGroupInformation proxyUgi = CurrentUser.getProxyUGI(); Assert.assertNotNull(proxyUgi); Assert.assertEquals(proxyUgi.getUserName(), EntityBuilderTestUtil.USER); Assert.assertEquals(CurrentUser.getAuthenticatedUser(), "real"); Assert.assertEquals(CurrentUser.getUser(), EntityBuilderTestUtil.USER); }