public static boolean validateStream(String stream){
  try {
    return stream.matches("(?i)^" + USERNAME_REGEX + "$");
  }
 catch (  PatternSyntaxException|NullPointerException ex) {
    return false;
  }
}

public static boolean validateStream ( String stream ) { try { return stream . matches ( "(?i)^" + USERNAME_REGEX + "$" ) ; } catch ( PatternSyntaxException | NullPointerException ex ) { return false ; } }
checks if the given name is a valid stream ( no leading # and valid otherwise ) .
