code: private Mode lookupCreateMode(String name) {
      if (name == null)
        return null;
      name = name.trim();
      Mode mode = (Mode)modeMap.get(name);
      if (mode == null) {
        mode = new Mode(name, defaultBaseMode);
        modeMap.put(name, mode);
      }
      return mode;
    }
docs: Gets a mode with the given name from the mode map.
  If not present then it creates a new mode extending the default base mode.
  
  @param name The mode to look for or create if it does not exist.
  @return Always a not null mode.