/** Returns the larger of this and the given limit */ public Limit max(Limit other) { return this.isLargerOrEqualTo(other) ? this : other; }
/** Returns true if these two ranges overlap */ public boolean overlaps(Range other) { if (other.from.isSmallerOrEqualTo(this.to) && other.to.isLargerOrEqualTo(this.from)) return true; if (other.to.isLargerOrEqualTo(this.from) && other.from.isSmallerOrEqualTo(this.to)) return true; return false; }