code: public static String canonicalize(String str) {
  	if (str == null) return null;
  	int length = str.length();
  	char ch;
  	StringBuffer buf = new StringBuffer(length);
  	for (int i=0;i<length;i++) {
  	    ch = str.charAt(i);
  	    if (ch == '_') continue;
  	    buf.append( Character.toLowerCase(ch) );
  	}
  	return buf.toString();
      }
docs: Canonicalizes a string by removing any underscores and
  moving all characters to lowercase.
  
  @param str string to canonicalize
  @return canonicalized string