code: private CharSequence getPreferenceHeaderTitle() {
          CharSequence originalTitle = getText(R.string.new_navigation_preference_title);
          CharSequence title = originalTitle;
          int counter = 1;
  
          while (isTitleAlreadyUsed(title)) {
              title = originalTitle + " (" + counter + ")";
              counter++;
          }
  
          return title;
      }
docs: Returns an unique title, which can be used for a new preference header.
  
  @return The title as an instance of the class {@link CharSequence}