### Question:
EndpointServer { @Override public boolean equals(Object o) { return o instanceof EndpointServer && (mHost == ((EndpointServer) o).mHost || (mHost != null && mHost.equalsIgnoreCase(((EndpointServer) o).mHost))) && (((EndpointServer) o).mNetwork == mNetwork || ((EndpointServer) o).mNetwork.equalsIgnoreCase(mNetwork)) && ((EndpointServer) o).mPort == 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 testEquals() throws Exception { EndpointServer s1, s2; s1 = new EndpointServer("beta.kontalk.net"); s2 = new EndpointServer("beta.kontalk.net|127.0.0.1"); assertNotEquals(s1, s2); assertNotEquals(s2, s1); s1 = new EndpointServer("beta.kontalk.net"); s2 = new EndpointServer("beta.kontalk.net"); assertEquals(s1, s2); assertEquals(s2, s1); }