### Question:
EndpointServer { public int getPort() { return mPort; } EndpointServer(String url);  EndpointServer(String network, String host, int port); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String getHost(); int getPort(); int getSecurePort(); String getNetwork(); static boolean validate(String value); static final int DEFAULT_PORT; }### Answer:
@Test public void testGetPort() throws Exception { EndpointServer s; s = new EndpointServer("beta.kontalk.net"); assertEquals(EndpointServer.DEFAULT_PORT, s.getPort()); s = new EndpointServer("beta.kontalk.net|127.0.0.1"); assertEquals(EndpointServer.DEFAULT_PORT, s.getPort()); s = new EndpointServer("beta.kontalk.net|127.0.0.1:5999"); assertEquals(5999, s.getPort()); }