@Override public boolean equals(final Object obj){
  if (obj instanceof Protocol) {
    final Protocol p=(Protocol)obj;
    return (defaultPort == p.getDefaultPort() && scheme.equalsIgnoreCase(p.getScheme()) && secure == p.isSecure() && socketFactory.equals(p.getSocketFactory()));
  }
 else {
    return false;
  }
}

@ Override public boolean equals ( final Object obj ) { if ( obj instanceof Protocol ) { final Protocol p = ( Protocol ) obj ; return ( defaultPort == p . getDefaultPort ( ) && scheme . equalsIgnoreCase ( p . getScheme ( ) ) && secure == p . isSecure ( ) && socketFactory . equals ( p . getSocketFactory ( ) ) ) ; } else { return false ; } }
return true if the specified object equals this object .
