### Question:
AuthUtils { public static synchronized Configuration getKerberosJAASConfiguration() throws Exception { if (kerberosConfig == null) { String configLocation = getKerberosLoginConfigLocation(); if (configLocation != null && !configLocation.isEmpty()) { kerberosConfig = createKerberosJAASConfiguration(configLocation); } } return kerberosConfig; }  static String getKerberosLoginConfigLocation(); static synchronized Configuration getKerberosJAASConfiguration(); static Configuration createKerberosJAASConfiguration(String kerberosLoginConfig); static Subject getKerberosSubject();  }### Answer:
@Test public void testLoadJAASConfigOnce() { File loginConfigFile = createTestKrb5LoginConfigFile(); Configuration conf1 = null; Configuration conf2 = null; try { System.setProperty(GatewayConfig.KRB5_LOGIN_CONFIG, loginConfigFile.getAbsolutePath()); conf1 = AuthUtils.getKerberosJAASConfiguration(); conf2 = AuthUtils.getKerberosJAASConfiguration(); } catch (Throwable e) { fail(e.getMessage()); } finally { System.clearProperty(GatewayConfig.KRB5_LOGIN_CONFIG); } assertNotNull(conf1); assertNotNull(conf2); assertSame(conf1, conf2); }