InetSocketAddress a = (InetSocketAddress) obj; return addr.equals(a.addr) && a.port == port;
InetSocketAddress sa = (InetSocketAddress) obj;  if (addr == null && sa.addr != null) return false; else if (addr == null && sa.addr == null) return hostname.equals(sa.hostname) && sa.port == port; else return addr.equals(sa.addr) && sa.port == port;
  public final boolean equals (Object obj)  {    // InetSocketAddress objects are equal when addr and port are equal.    // The hostname may differ.    if (obj instanceof InetSocketAddress)      {        InetSocketAddress a = (InetSocketAddress) obj;        return addr.equals(a.addr) && a.port == port;      }        return false;  }