code: int rangeEnd(int start, int limitp, int val) {
          int c;
          int limit = Math.min(highStart, limitp);
  
          for (c = start+1; c < limit; c++) {
              if (get(c) != val) {
                  break;
              }
          }
          if (c >= highStart) {
              c = limitp;
          }
          return c - 1;
      }
docs: Find the last character in a contiguous range of characters with the
  same Trie2 value as the input character.
  
  @param c  The character to begin with.
  @return   The last contiguous character with the same value.