code: public static CharRanges withRanges(int... ranges) {
      if ((ranges.length & 1) != 0) { throw new IllegalArgumentException(); }
      for (int i = 1; i < ranges.length; ++i) {
        if (ranges[i] <= ranges[i - 1]) {
          throw new IllegalArgumentException(ranges[i] + " > " + ranges[i - 1]);
        }
      }
      return new CharRanges(ranges);
    }
docs: Returns an instance containing the given ranges.
  @param ranges An even-length ordered sequence of non-overlapping,
  non-contiguous, [inclusive start, exclusive end) ranges.