code: func (iter *MockStateRangeQueryIterator) Next() (*queryresult.KV, error) {
  	if iter.Closed == true {
  		err := errors.New("MockStateRangeQueryIterator.Next() called after Close()")
  		mockLogger.Errorf("%+v", err)
  		return nil, err
  	}
  
  	if iter.HasNext() == false {
  		err := errors.New("MockStateRangeQueryIterator.Next() called when it does not HaveNext()")
  		mockLogger.Errorf("%+v", err)
  		return nil, err
  	}
  
  	for iter.Current != nil {
  		comp1 := strings.Compare(iter.Current.Value.(string), iter.StartKey)
  		comp2 := strings.Compare(iter.Current.Value.(string), iter.EndKey)
  		// compare to start and end keys. or, if this is an open-ended query for
  		// all keys, it should always return the key and value
  		if (comp1 >= 0 && comp2 < 0) || (iter.StartKey == "" && iter.EndKey == "") {
  			key := iter.Current.Value.(string)
  			value, err := iter.Stub.GetState(key)
  			iter.Current = iter.Current.Next()
  			return &queryresult.KV{Key: key, Value: value}, err
  		}
  		iter.Current = iter.Current.Next()
  	}
  	err := errors.New("MockStateRangeQueryIterator.Next() went past end of range")
  	mockLogger.Errorf("%+v", err)
  	return nil, err
  }
docs: // Next returns the next key and value in the range query iterator.