### Question:
HASUtils { public static String getUserNameFromKerberos(String username) { if (username.contains("@")){ int firstPos = username.indexOf("@"); if (firstPos == username.lastIndexOf("@")) { username = username.substring(0,firstPos); } else { throw new IllegalArgumentException(); } } return username; }  static InetSocketAddress getISServiceRpcAddresses(
      Configuration conf); static InetSocketAddress getAuthzServiceRpcAddresses(
      Configuration conf); static boolean parseHelpArgument(String[] args, 
      String helpDescription, PrintStream out, boolean printGenericCommandUsage); static String getUserNameFromKerberos(String username); static Options helpOptions; static Option helpOpt; }### Answer:
@Test public void testGetUserNameFromKerberos() throws Exception { String FQDN = "server-15388.novalocal@NOVALOCAL"; String username = HASUtils.getUserNameFromKerberos(FQDN); System.out.println(username); assertEquals(username, "server-15388.novalocal"); }