static List<ReversedRowRange> flipAndReverseRanges(List<RowRange> ranges) {
      List<ReversedRowRange> flippedRanges = new ArrayList<>(ranges.size());
      for (int i = ranges.size() - 1; i >= 0; i--) {
        RowRange origRange = ranges.get(i);
        ReversedRowRange newRowRange = new ReversedRowRange(origRange.startRow,
          origRange.startRowInclusive, origRange.stopRow, origRange.isStopRowInclusive());
        flippedRanges.add(newRowRange);
      }
      return flippedRanges;
    }
Rebuilds the sorted ranges (by startKey) into an equivalent sorted list of ranges, only by
stopKey instead. Descending order and the ReversedRowRange compareTo implementation make sure
that we can use Collections.binarySearch().
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java