docs: @SuppressWarnings("unchecked")
    private static void updateLanguageTone(Map<String, Object> user, List<ToneScore> languageTone,
        boolean maintainHistory) {
  
      List<String> currentLanguage = new ArrayList<String>();
      Map<String, Object> currentLanguageObject = new HashMap<String, Object>();
  
      // Process each language tone and determine if it is high or low
      for (ToneScore tone : languageTone) {
        if (tone.getScore() >= LANGUAGE_HIGH_SCORE_THRESHOLD) {
          currentLanguage.add(tone.getToneName().toLowerCase() + "_high");
          currentLanguageObject.put("tone_name", tone.getToneName().toLowerCase());
          currentLanguageObject.put("score", tone.getScore());
          currentLanguageObject.put("interpretation", "likely high");
        } else if (tone.getScore() <= LANGUAGE_NO_SCORE_THRESHOLD) {
          currentLanguageObject.put("tone_name", tone.getToneName().toLowerCase());
          currentLanguageObject.put("score", tone.getScore());
          currentLanguageObject.put("interpretation", "no evidence");
        } else {
          currentLanguageObject.put("tone_name", tone.getToneName().toLowerCase());
          currentLanguageObject.put("score", tone.getScore());
          currentLanguageObject.put("interpretation", "likely medium");
        }
      }
  
      // update user language tone
      Map<String, Object> language = (Map<String, Object>) ((Map<String, Object>) user.get("tone")).get("language");
  
      // the current language pulled from tone
      language.put("current", currentLanguage);
  
      // if history needs to be maintained
      if (maintainHistory) {
        List<Map<String, Object>> history = new ArrayList<Map<String, Object>>();
        if (language.get("history") != null) {
          history = (List<Map<String, Object>>) language.get("history");
        }
        history.add(currentLanguageObject);
        language.put("history", history);
      }
    }