docs: public static Map<String, Object> updateUserTone(Map<String, Object> context, ToneAnalysis toneAnalyzerPayload,
        boolean maintainHistory) {
  
      List<ToneScore> emotionTone = new ArrayList<ToneScore>();
      List<ToneScore> languageTone = new ArrayList<ToneScore>();
      List<ToneScore> socialTone = new ArrayList<ToneScore>();
  
      // If the context doesn't already contain the user object, initialize it
      if (!context.containsKey("user")) {
        context.put("user", initUser());
      }
  
      // For convenience sake, define a variable for the user object to
      @SuppressWarnings("unchecked")
      Map<String, Object> user = (Map<String, Object>) context.get("user");
  
      if (toneAnalyzerPayload != null && toneAnalyzerPayload.getDocumentTone() != null) {
        List<ToneCategory> tones = toneAnalyzerPayload.getDocumentTone().getToneCategories();
        for (ToneCategory tone : tones) {
          if (tone.getCategoryId().equals(EMOTION_TONE_LABEL)) {
            emotionTone = tone.getTones();
          }
          if (tone.getCategoryId().equals(LANGUAGE_TONE_LABEL)) {
            languageTone = tone.getTones();
          }
          if (tone.getCategoryId().equals(SOCIAL_TONE_LABEL)) {
            socialTone = tone.getTones();
          }
        }
  
        updateEmotionTone(user, emotionTone, maintainHistory);
        updateLanguageTone(user, languageTone, maintainHistory);
        updateSocialTone(user, socialTone, maintainHistory);
  
      }
  
      context.put("user", user);
      return user;
    }