func (m *StateDB) WithState(ns, key string, value []byte) *StateDB {
	nsState, ok := m.state[ns]
	if !ok {
		nsState = make(map[string][]byte)
		m.state[ns] = nsState
	}
	nsState[key] = value
	return m
}
WithState sets the state
package mocks
import (
	"sort"
	"strings"
	"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb"
)
type StateDB struct {
	state             map[string]map[string][]byte
	queryResults      map[string][]*statedb.VersionedKV
	error             error
	queryError        error
	itProvider        func() *KVIterator
	bytesKeySupported bool
}
func NewStateDB() *StateDB {
	return &StateDB{
		state:        make(map[string]map[string][]byte),
		queryResults: make(map[string][]*statedb.VersionedKV),
		itProvider:   NewKVIterator,
	}
}