### Question:
EndpointServer { public static boolean validate(String value) { return sPattern.matcher(value).matches(); } 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 testValidate() throws Exception { assertTrue(EndpointServer.validate("beta.kontalk.net")); assertTrue(EndpointServer.validate("beta.kontalk.net|127.0.0.1")); assertTrue(EndpointServer.validate("beta.kontalk.net|127.0.0.1:5999")); assertFalse(EndpointServer.validate("beta.kontalk.net|:5999")); assertFalse(EndpointServer.validate("beta.kontalk.net|ping/test/host:5999")); assertFalse(EndpointServer.validate("prova:5999")); }