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