code: @Override
      public final boolean hasNext() {
          resetToLastKey();
  
          // Make sure that parent axis is moved for the first time.
          if (mIsFirst) {
              mIsFirst = false;
              if (mParentAxis.hasNext()) {
                  mChildAxis.reset(mParentAxis.next());
              } else {
                  resetToStartKey();
                  return false;
              }
          }
  
          // Execute child axis for each node found with parent axis.
          boolean hasNext = false;
          while (!(hasNext = mChildAxis.hasNext())) {
              if (mParentAxis.hasNext()) {
                  mChildAxis.reset(mParentAxis.next());
              } else {
                  break;
              }
          }
          if (hasNext) {
              mChildAxis.next();
              return true;
          }
  
          resetToStartKey();
          return false;
      }
docs: {@inheritDoc}