Reverse the order of an interval. if i.getOrder() is upward,
return a downward interval, and vice-versa.

A fifth stay a fifth.

@return a new Interval object.
499788
public static Interval reverseOrder(Interval i) {
		return new Interval(i.getLabel(), i.getQuality(), (byte) -i.getDirection());
	}
58501
public Range move(int offset) {
        if (offset == 0)
            return this;
        return new Range(lower + offset, upper + offset, reversed);
    }
927375
@Override
  public IVersionRange invert() {
    IVersionRange irange1 = range1.invert();
    IVersionRange irange2 = range2.invert();
    return new OrRange(irange1, irange2);
  }
499321
public int decrementAndGet(T obj) {
        int prev, next;
        do {
            prev = get(obj);
            next = prev - 1;
        } while (!compareAndSet(obj, prev, next));
        return next;
    }
440561
public static <E> Ordering<Multiset.Entry<E>>
  byCountDescendingThenItemAscendingOrdering(Comparator<? super E> itemComparator) {
    final Ordering<Multiset.Entry<E>> byCount = byCountOrdering();
    final Ordering<Multiset.Entry<E>> byCountReversed = byCount.reverse();
    final Ordering<Multiset.Entry<E>> byElement = byElementOrdering(itemComparator);
    return byCountReversed.compound(byElement);
  }
240184
public static int[] getOrder(double[] values, boolean descending) {
        return DMatrixUtils.getOrder(values, IntStream.range(0, values.length).toArray(), descending);
    }
743269
public BeanComparator<T> reverse() {
        BeanComparator<T> bc = new BeanComparator<T>(this);
        bc.mOrderByName = mOrderByName;
        bc.mUsingComparator = mUsingComparator;
        bc.mFlags = mFlags ^ 0x01;
        return bc;
    }
783262
private Range<RangeTimeUUID> toRange(@Nullable UUID start, @Nullable UUID end, boolean reversed) {
        // If the range is reversed then start and end will also be reversed and must therefore be swapped.
        if (reversed) {
            UUID tmp = start;
            start = end;
            end = tmp;
        }

        if (start == null) {
            if (end == null) {
                return Range.all();
            } else {
                return Range.atMost(new RangeTimeUUID(end));
            }
        } else if (end == null) {
            return Range.atLeast(new RangeTimeUUID(start));
        }
        return Range.closed(new RangeTimeUUID(start), new RangeTimeUUID(end));
    }
746523
public OrderingList<S> reverseDirections() {
        if (size() == 0) {
            return this;
        }
        OrderingList<S> reversedList = emptyList();
        for (int i=0; i<size(); i++) {
            reversedList = reversedList.concat(get(i).reverse());
        }
        return reversedList;
    }
27422
public Direction direction() {
        double range = this.end - this.start;
        if (!Op.isFinite(range) || Op.isEq(range, 0.0)) {
            return Direction.Zero;
        }
        if (Op.isGt(range, 0.0)) {
            return Direction.Positive;
        }
        return Direction.Negative;
    }
872317
public int noopIntervalSeconds() {
    try {
      return parsePositiveInteger(get(Names.SET_NOOP_INTERVAL));
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException(
          "Bad value for '" + Names.SET_NOOP_INTERVAL.value() + "'; " + e.getMessage());
    }
  }
1288613
public int first() {
        long remaining;
        long next;

        remaining = data;
        while (true) {
            next = remaining / BASE;
            if (next == 0) {
                return (int) remaining - 1;
            }
            remaining = next;
        }
    }
509183
public ComparatorChain<E> setComparator(final int index, final Comparator<E> comparator, final boolean reverse) {
		checkLocked();

		chain.set(index, comparator);
		if (reverse == true) {
			orderingBits.set(index);
		} else {
			orderingBits.clear(index);
		}
		return this;
	}
885229
public static void reverse(int[] a) {
        int i = 0, j = a.length - 1;
        while (i < j) {
            SortUtils.swap(a, i++, j--);  // code for swap not shown, but easy enough
        }
    }
1232129
final public function getOrdinal()
    {
        if ($this->ordinal === null) {
            $ordinal = 0;
            $value   = $this->value;
            foreach (self::detectConstants(static::class) as $constValue) {
                if ($value === $constValue) {
                    break;
                }
                ++$ordinal;
            }

            $this->ordinal = $ordinal;
        }

        return $this->ordinal;
    }
948916
public function invert()
	{
		$interval = $this->copy($this->interval);
		$interval->invert = $interval->invert ? 0 : 1;

		return new DateInterval($interval);
	}
409094
public IntervalFrequency getRefreshFrequency() {
        switch (mRefreshInterval) {
            case REALTIME_REFRESH_INTERVAL:
                return IntervalFrequency.REALTIME;
            case HIGH_REFRESH_INTERVAL:
                return IntervalFrequency.HIGH;
            case LOW_REFRESH_INTERVAL:
                return IntervalFrequency.LOW;
            case MEDIUM_REFRESH_INTERVAL:
                return IntervalFrequency.MEDIUM;
            default:
                return IntervalFrequency.NONE;
        }
    }