void initialize(boolean reversed) {
      // Avoid double initialization
      assert !this.initialized;
      this.reversed = reversed;
      if (reversed) {
        // If we are doing a reverse scan, we can reverse the ranges (both the elements in
        // the list as well as their start/stop key), and use the same algorithm.
        this.ranges = flipAndReverseRanges(sortedAndMergedRanges);
      } else {
        this.ranges = sortedAndMergedRanges;
      }
      this.initialized = true;
    }
Abstraction over the ranges of rows to return from this filter, regardless of forward or
reverse scans being used. This Filter can use this class, agnostic of iteration direction, as
the same algorithm can be applied in both cases.
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java