code: func (v *rangeQueryResultsValidator) validate() (bool, error) {
  	rqResults := v.rqInfo.GetRawReads().GetKvReads()
  	itr := v.itr
  	var result statedb.QueryResult
  	var err error
  	if result, err = itr.Next(); err != nil {
  		return false, err
  	}
  	if len(rqResults) == 0 {
  		return result == nil, nil
  	}
  	for i := 0; i < len(rqResults); i++ {
  		kvRead := rqResults[i]
  		logger.Debugf("comparing kvRead=[%#v] to queryResponse=[%#v]", kvRead, result)
  		if result == nil {
  			logger.Debugf("Query response nil. Key [%s] got deleted", kvRead.Key)
  			return false, nil
  		}
  		versionedKV := result.(*statedb.VersionedKV)
  		if versionedKV.Key != kvRead.Key {
  			logger.Debugf("key name mismatch: Key in rwset = [%s], key in query results = [%s]", kvRead.Key, versionedKV.Key)
  			return false, nil
  		}
  		if !version.AreSame(versionedKV.Version, convertToVersionHeight(kvRead.Version)) {
  			logger.Debugf(`Version mismatch for key [%s]: Version in rwset = [%#v], latest version = [%#v]`,
  				versionedKV.Key, versionedKV.Version, kvRead.Version)
  			return false, nil
  		}
  		if result, err = itr.Next(); err != nil {
  			return false, err
  		}
  	}
  	if result != nil {
  		// iterator is not exhausted - which means that there are extra results in the given range
  		logger.Debugf("Extra result = [%#v]", result)
  		return false, nil
  	}
  	return true, nil
  }
docs: // validate iterates through the results that are present in the range-query-info (captured during simulation)
  // and the iterator (latest view of the `committed state` i.e., db + updates). At first mismatch between the results
  // from the two sources (the range-query-info and the iterator), the validate returns false.