boolean (@Nullable IntervalNode<T> root, int start, int end, int modCountBefore, int deltaUpToRootExclusive, @NotNull Processor<? super T> processor) { if (root == null) { return true; } assert root.isValid(); int delta = deltaUpToRootExclusive + root.delta; if (start > maxEndOf(root, deltaUpToRootExclusive)) { return true; // right of the rightmost interval in the subtree } if (!processOverlappingWith(root.getLeft(), start, end, modCountBefore, delta, processor)) return false; int myStartOffset = root.intervalStart() + delta; int myEndOffset = root.intervalEnd() + delta; boolean overlaps = Math.max(myStartOffset, start) <= Math.min(myEndOffset, end); if (overlaps) { if (!root.processAliveKeys(processor)) return false; if (getModCount() != modCountBefore) throw new ConcurrentModificationException(); } if (end < myStartOffset) { return true; // left of the root, cant be in the right subtree } return processOverlappingWith(root.getRight(), start, end, modCountBefore, delta, processor); }