public void joinChannels(Set<String> channels){
  Set<String> valid=new LinkedHashSet<>();
  Set<String> invalid=new LinkedHashSet<>();
  for (  String channel : channels) {
    String checkedChannel=Helper.toValidChannel(channel);
    if (checkedChannel == null) {
      invalid.add(channel);
    }
 else {
      valid.add(checkedChannel);
    }
  }
  for (  String channel : invalid) {
    listener.onJoinError(channels,channel,JoinError.INVALID_NAME);
  }
  joinValidChannels(valid);
}

public void joinChannels ( Set < String > channels ) { Set < String > valid = new LinkedHashSet < > ( ) ; Set < String > invalid = new LinkedHashSet < > ( ) ; for ( String channel : channels ) { String checkedChannel = Helper . toValidChannel ( channel ) ; if ( checkedChannel == null ) { invalid . add ( channel ) ; } else { valid . add ( checkedChannel ) ; } } for ( String channel : invalid ) { listener . onJoinError ( channels , channel , JoinError . INVALID_NAME ) ; } joinValidChannels ( valid ) ; }
join a rename of channels . sorts out invalid channels and outputs an error message , then joins the valid channels .
