/** * Checks if a given index is within a quoted range. * * @param index to check if it is part of a quoted range. * @return whether the query contains a quoted range at {@literal index}. */ public boolean isQuoted(int index) { return quotedRanges.stream().anyMatch(r -> r.contains(index)); } }
private OrderLine getRequiredOrderLineByIndex(int index) { Range<Integer> allowedIndexRange = Range.from(Bound.inclusive(0))// .to(Bound.exclusive(orderLines.size())); Assert.isTrue(allowedIndexRange.contains(index), String.format("Invalid order line index %s. Required: %s!", index, allowedIndexRange)); return this.orderLines.get(index); }