code: @Override
      public final boolean hasNext() {
  
          resetToLastKey();
  
          if (mIsFirst) {
              mIsFirst = false;
  
              try {
  
                  AtomicValue[] operandOne = null;
                  if (mOperand1 instanceof LiteralExpr) {
                      operandOne = new AtomicValue[1];
                      operandOne[0] = ((LiteralExpr)mOperand1).evaluate();
                  } else if (mOperand1.hasNext()) {
                      // atomize operands
                      operandOne = atomize(mOperand1);
                  }
  
                  if (operandOne != null) {
  
                      AtomicValue[] operandTwo = null;
  
                      if (mOperand2 instanceof LiteralExpr) {
                          operandTwo = new AtomicValue[1];
                          operandTwo[0] = ((LiteralExpr)mOperand2).evaluate();
                      } else if (mOperand2.hasNext()) {
                          // atomize operands
                          operandTwo = atomize(mOperand2);
                      }
  
                      if (operandTwo != null) {
  
                          hook(operandOne, operandTwo);
                          // get comparison result
                          final boolean resultValue = compare(operandOne, operandTwo);
                          final AtomicValue result = new AtomicValue(resultValue);
  
                          // add retrieved AtomicValue to item list
                          final int itemKey = getItemList().addItem(result);
                          moveTo(itemKey);
                          return true;
                      }
                  }
  
              } catch (TTXPathException exc) {
                  throw new RuntimeException(exc);
              }
          }
          // return empty sequence or function called more than once
          resetToStartKey();
          return false;
      }
docs: {@inheritDoc}