/** * Calculates the Segment that represents the merger of this segment with the given {@code other} segment. * * @param other the segment to merge this one with * @return The Segment representing the merged segments */ public Segment mergedWith(Segment other) { Assert.isTrue(this.isMergeableWith(other), () -> "Given Segment cannot be merged with this segment."); return new Segment(Math.min(this.segmentId, other.segmentId), this.mask >>> 1); }
/** * Calculates the Segment that represents the merger of this segment with the given {@code other} segment. * * @param other the segment to merge this one with * @return The Segment representing the merged segments */ public Segment mergedWith(Segment other) { Assert.isTrue(this.isMergeableWith(other), () -> "Given Segment cannot be merged with this segment."); return new Segment(Math.min(this.segmentId, other.segmentId), this.mask >>> 1); }
/** * Calculates the Segment that represents the merger of this segment with the given {@code other} segment. * * @param other the segment to merge this one with * @return The Segment representing the merged segments */ public Segment mergedWith(Segment other) { Assert.isTrue(this.isMergeableWith(other), () -> "Given Segment cannot be merged with this segment."); return new Segment(Math.min(this.segmentId, other.segmentId), this.mask >>> 1); }