code: func (itr *combinedIterator) serveEndKeyIfNeeded() (statedb.QueryResult, error) {
  	if !itr.includeEndKey || itr.endKeyServed {
  		logger.Debugf("Endkey not to be served. Returning nil... [toInclude=%t, alreadyServed=%t]",
  			itr.includeEndKey, itr.endKeyServed)
  		return nil, nil
  	}
  	logger.Debug("Serving the endKey")
  	var vv *statedb.VersionedValue
  	var err error
  	vv = itr.updates.Get(itr.ns, itr.endKey)
  	logger.Debugf("endKey value from updates:%s", vv)
  	if vv == nil {
  		if vv, err = itr.db.GetState(itr.ns, itr.endKey); err != nil {
  			return nil, err
  		}
  		logger.Debugf("endKey value from stateDB:%s", vv)
  	}
  	itr.endKeyServed = true
  	if vv == nil {
  		return nil, nil
  	}
  	vkv := &statedb.VersionedKV{
  		CompositeKey:   statedb.CompositeKey{Namespace: itr.ns, Key: itr.endKey},
  		VersionedValue: statedb.VersionedValue{Value: vv.Value, Version: vv.Version}}
  
  	if isDelete(vkv) {
  		return nil, nil
  	}
  	return vkv, nil
  }
docs: // serveEndKeyIfNeeded returns the endKey only once and only if includeEndKey was set to true
  // in the constructor of combinedIterator.