code: private int findRunLimit(int index, int limit, byte[] validSet) {
          --index;
          loop:
              while (++index < limit) {
                  byte t = resultTypes[index];
                  for (int i = 0; i < validSet.length; ++i) {
                      if (t == validSet[i]) {
                          continue loop;
                      }
                  }
                  // didn't find a match in validSet
                  return index;
              }
              return limit;
      }
docs: Return the limit of the run starting at index that includes only resultTypes in validSet.
  This checks the value at index, and will return index if that value is not in validSet.