code: private int lastIndexOfNumericTag(String category) {
      if (category == null) {
        return -1;
      }
      int last = -1;
      for (int i = category.length() - 1; i >= 0; i--) {
        if (isLabelAnnotationIntroducingCharacter(category.charAt(i))) {
          boolean onlyDigitsFollow = false;
          for (int j = i + 1; j < category.length(); j++) {
            onlyDigitsFollow = true;
            if (!(Character.isDigit(category.charAt(j)))) {
              onlyDigitsFollow = false;
              break;
            }
          }
          if (onlyDigitsFollow) {
            last = i;
          }
        }
      }
      return last;
    }
docs: Returns the index within this string of the last occurrence of a
  isLabelAnnotationIntroducingCharacter which is followed by only
  digits, corresponding to a numeric tag at the end of the string.
  Example: <code>lastIndexOfNumericTag("NP-TMP-1") returns
  6</code>.
  
  @param category A String category
  @return The index within this string of the last occurrence of a
  isLabelAnnotationIntroducingCharacter which is followed by only
  digits