@Override public void removeHandshakeCompletedListener(HandshakeCompletedListener listener){
  if (listener == null) {
    throw new IllegalArgumentException("Provided listener is null");
  }
  if (listeners == null) {
    throw new IllegalArgumentException("Provided listener is not registered");
  }
  if (!listeners.remove(listener)) {
    throw new IllegalArgumentException("Provided listener is not registered");
  }
}

@ Override public void removeHandshakeCompletedListener ( HandshakeCompletedListener listener ) { if ( listener == null ) { throw new IllegalArgumentException ( "Provided listener is null" ) ; } if ( listeners == null ) { throw new IllegalArgumentException ( "Provided listener is not registered" ) ; } if ( ! listeners . remove ( listener ) ) { throw new IllegalArgumentException ( "Provided listener is not registered" ) ; } }
this method works according to the specification of implemented class .
