### Question:
ThriftEndPoint { static String extractPrincipalName(String principal) { String name = principal; int i = principal.indexOf("/"); if (i == -1) { i = principal.indexOf("@"); } if (i > -1) { name = principal.substring(0, i); } return name; }  static TTransport createClientTransport(ServerConfiguration conf,
      String host, int port); static TProcessor createTProcessorWrapper(ServerConfiguration conf,
      boolean isAdmin, TProcessor tProcessor); static TServerSocket createTServerSocket(ServerConfiguration conf); static TServerSocket createAdminTServerSocket(ServerConfiguration conf); static TTransportFactory createTTransportFactory(
      ServerConfiguration conf); static String getServerAddress(ServerConfiguration conf); static int getServerPort(ServerConfiguration conf);  }### Answer:
@Test public void testExtractPrincipalName() { Assert.assertEquals("n", ThriftEndPoint.extractPrincipalName("n")); Assert.assertEquals("n", ThriftEndPoint.extractPrincipalName("n/h")); Assert.assertEquals("n", ThriftEndPoint.extractPrincipalName("n/h@R")); }