public static String toValidChannel(String channel){
  if (channel == null) {
    return null;
  }
  if (!validateChannel(channel)) {
    return null;
  }
  if (!channel.startsWith("#")) {
    channel="#" + channel;
  }
  return StringUtil.toLowerCase(channel);
}

public static String toValidChannel ( String channel ) { if ( channel == null ) { return null ; } if ( ! validateChannel ( channel ) ) { return null ; } if ( ! channel . startsWith ( "#" ) ) { channel = "#" + channel ; } return StringUtil . toLowerCase ( channel ) ; }
checks if the given stream / channel is valid and turns it into a channel if necessary ( leading # and all lowercase ) .
