### Question:
HostPort { public static HostPort parseHostPort(String string) { String[] strings = string.split("_"); return new HostPort(strings[0], Integer.parseInt(strings[1])); } HostPort(String host, int port); String getHost(); int getPort(); String getHostPort(); static HostPort parseHostPort(String string);  }### Answer:
@Test public void testParseHostPort() { String string = "127.0.0.1_2184"; HostPort hostPort = HostPort.parseHostPort(string); assertTrue(hostPort.getHost().equals("127.0.0.1")); assertTrue(hostPort.getPort() == 2184); }