private void advance() {
            TKey innerKey, outerKey;
            int comp;

            try {
                while(true) {
                    if (increment[0]) {
                        outerRow = outerIterator.next();
                    }
                    if (increment[1]) {
                        innerRow = innerIterator.next();
                    }

                    innerKey = innerKeySelector.apply(innerRow);
                    outerKey = outerKeySelector.apply(outerRow);
                    comp = innerKey.compareTo(outerKey);
                    if (comp == 0) {
                        nextItem = resultBuilder.apply(outerRow, innerRow);
                        increment[0] = true;
                        increment[1] = false;
                        return;
                    } else if (comp < 0) {
                        increment[0] = false;
                        increment[1] = true;
                    } else if (comp > 0) {
                        increment[0] = true;
                        increment[1] = false;
                    }
                }
            } catch (NoSuchElementException nsee) {
                nextItem = null;
                return;
            }
        }