code: private String lookupItemName(String itemName, boolean autoAdd) {
          String indexedName = index.get(itemName.toLowerCase());
  
          if (indexedName == null && autoAdd) {
              index.put(itemName.toLowerCase(), itemName);
          }
  
          return indexedName == null ? itemName : indexedName;
      }
docs: Performs a case-insensitive lookup of the item name in the index.
  
  @param itemName Item name
  @param autoAdd If true and item name not in index, add it.
  @return Item name as stored internally. If not already stored, returns the item name as it
  was specified in itemName.