question: 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 ) ; }
target:  Checks if the given stream/channel is valid and turns it into a channel if necessary (leading # and all lowercase).