### Question:
ThriftEndPoint { static String extractPrincipalHost(String principal) { String host = null; int i = principal.indexOf("/"); if (i > -1) { int j = principal.lastIndexOf("@"); if (j > -1) { host = principal.substring(i + 1, j); } else { host = principal.substring(i + 1); } } return host; }  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 testExtractPrincipalHost() { Assert.assertNull(ThriftEndPoint.extractPrincipalHost("n")); Assert.assertEquals("h", ThriftEndPoint.extractPrincipalHost("n/h")); Assert.assertEquals("h", ThriftEndPoint.extractPrincipalHost("n/h@R")); }