code: public static long length(final Iterable<Range<Long>> ranges) {
          checkNotNull(ranges);
          RangeSet<Long> rangeSet = TreeRangeSet.create();
          for (Range<Long> range : ranges) {
              rangeSet.add(range);
          }
          long length = 0L;
          for (Range<Long> range : rangeSet.asRanges()) {
              length += length(range);
          }
          return length;
      }
docs: Return the sum of lengths of the specified ranges, after merging overlapping ranges.
  
  @param ranges ranges, must not be null, must not contain any null ranges, and all ranges must be [closed, open)
  @return the sum of lengths of the specified ranges, after merging overlapping ranges