OGM-396 Adding more tests
OGM-396 Adding test and fixing bug for state-based optimistic locking