code: private int checkVariants(String variants, String sep) {
          StringTokenIterator itr = new StringTokenIterator(variants, sep);
          while (!itr.isDone()) {
              String s = itr.current();
              if (!LanguageTag.isVariant(s)) {
                  return itr.currentStart();
              }
              itr.next();
          }
          return -1;
      }
docs: /*
  Check if the given variant subtags separated by the given
  separator(s) are valid