func (itr *StateDeltaIterator) GetKeyValue() (string, []byte) {
	if itr.done {
		logger.Warning("Iterator used after it has been exhausted. Last retrieved value will be returned")
	}
	key := itr.relevantKeys[itr.currentKeyIndex]
	value := itr.updates[key].GetValue()
	return key, value
}
GetKeyValue - see interface 'RangeScanIterator' for details
package statemgmt
type StateDeltaIterator struct {
	updates         map[string]*UpdatedValue
	relevantKeys    []string
	currentKeyIndex int
	done            bool
}
func NewStateDeltaRangeScanIterator(delta *StateDelta, chaincodeID string, startKey string, endKey string) *StateDeltaIterator {
	updates := delta.GetUpdates(chaincodeID)
	return &StateDeltaIterator{updates, retrieveRelevantKeys(updates, startKey, endKey), -1, false}
}
func retrieveRelevantKeys(updates map[string]*UpdatedValue, startKey string, endKey string) []string {
	relevantKeys := []string{}
	if updates == nil {
		return relevantKeys
	}
	for k, v := range updates {
		if k >= startKey && (endKey == "" || k <= endKey) && !v.IsDelete() {
			relevantKeys = append(relevantKeys, k)
		}
	}
	return relevantKeys
}
func (itr *StateDeltaIterator) Next() bool {
	itr.currentKeyIndex++
	if itr.currentKeyIndex < len(itr.relevantKeys) {
		return true
	}
	itr.currentKeyIndex--
	itr.done = true
	return false
}