@Override
    public IndexStoreEntry next() {
      if (needToCallHasNext) {
        hasNext();
      }
      // we set this again so that we know that has next needs to be called before the next call
      // hasNext will unset it. This forces us to call hasNext automatically if the user does not
      needToCallHasNext = true;
      return nextEntry;
    }
do not retain a reference to the returned object.
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MapIndexStore.java