anchor.diff:          _    -> ok
       end.
   
  -tester_changed_keys_get_entry(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_get_entry, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_set_entry(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_set_entry, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_update_entry(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_update_entry, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_delete_entry(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_delete_entry, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_read(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_read, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_write(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_write, 5, rw_suite_runs(1000)).
  -
  -tester_changed_keys_delete(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_delete, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_get_entries2(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_get_entries2, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_get_entries4(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_get_entries4, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_update_entries(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_update_entries, 4, rw_suite_runs(1000)).
  -
  -tester_changed_keys_delete_entries1(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_delete_entries1, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_delete_entries2(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_delete_entries2, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_get_load(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_get_load, 2, rw_suite_runs(1000)).
  -
  -tester_changed_keys_get_load2(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_get_load2, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_split_data1(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_split_data1, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_split_data2(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_split_data2, 3, rw_suite_runs(1000)).
  -
  -tester_changed_keys_get_data(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_get_data, 2, rw_suite_runs(1000)).
  -
  -tester_changed_keys_add_data(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_add_data, 2, rw_suite_runs(1000)).
  -
  -tester_changed_keys_check_db(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_check_db, 2, rw_suite_runs(1000)).
  -
  -tester_changed_keys_mult_interval(_Config) ->
  -    tester:test(?MODULE, prop_changed_keys_mult_interval, 5, rw_suite_runs(1000)).
  -
  -tester_stop_record_changes(_Config) ->
  -    tester:test(?MODULE, prop_stop_record_changes, 5, rw_suite_runs(1000)).
  -
  -
  -% helper functions:
  -
  --spec check_entry(DB::?TEST_DB:db(), Key::?RT:key(), ExpDBEntry::db_entry:entry(),
  -                  ExpRead::{ok, Value::?TEST_DB:value(), Version::?TEST_DB:version()} | {ok, empty_val, -1},
  -                  ExpExists::boolean(), Note::string()) -> true.
  -check_entry(DB, Key, ExpDBEntry, ExpRead, ExpExists, Note) ->
  -    ?equals_w_note(?TEST_DB:get_entry2(DB, Key), {ExpExists, ExpDBEntry}, Note),
  -    ?equals_w_note(?TEST_DB:get_entry(DB, Key), ExpDBEntry, Note),
  -    ?equals_w_note(?TEST_DB:read(DB, Key), ExpRead, Note),
  -    true.
  -
  -% note: use manageable values for ReadLock!
  --spec create_db_entry(Key::?RT:key(), Value::?DB:value(), WriteLock::boolean(),
  -                      ReadLock::0..1000, Version::?DB:version() | -1) -> db_entry:entry().
  -create_db_entry(Key, Value, WriteLock, ReadLock, Version) ->
  -    E1 = db_entry:new(Key, Value, Version),
  -    E2 = case WriteLock of
  -             true -> db_entry:set_writelock(E1);
  -             _    -> E1
  -         end,
  -    _E3 = inc_readlock(E2, ReadLock).
  -
  --spec inc_readlock(DBEntry::db_entry:entry(), Count::non_neg_integer()) -> db_entry:entry().
  -inc_readlock(DBEntry, 0) -> DBEntry;
  -inc_readlock(DBEntry, Count) -> inc_readlock(db_entry:inc_readlock(DBEntry), Count - 1).
  -
  --spec check_db(DB::?TEST_DB:db(),
  -               ExpCheckDB::{true, []} | {false, InvalidEntries::?TEST_DB:db_as_list()},
  -               ExpLoad::integer(),
  -               ExpData::?TEST_DB:db_as_list(), Note::string()) -> true.
  -check_db(DB, ExpCheckDB, ExpLoad, ExpData, Note) ->
  -    check_db(DB, ExpCheckDB, ExpLoad, ExpData, {[], []}, Note).
  -
  --spec check_db(DB::?TEST_DB:db(),
  -               ExpCheckDB::{true, []} | {false, InvalidEntries::?TEST_DB:db_as_list()},
  -               ExpLoad::integer(),
  -               ExpData::?TEST_DB:db_as_list(),
  -               ExpCKData::{UpdatedEntries::?TEST_DB:db_as_list(), DeletedKeys::[?RT:key()]},
  -               Note::string()) -> true.
  -check_db(DB, ExpCheckDB, ExpLoad, ExpData, ExpCKData, Note) ->
  -    ?equals_w_note(?TEST_DB:check_db(DB), ExpCheckDB, Note),
  -    ?equals_w_note(?TEST_DB:get_load(DB), ExpLoad, Note),
  -    ?equals_w_note(lists:sort(?TEST_DB:get_data(DB)), lists:sort(ExpData), Note),
  -    ?equals_w_note(?TEST_DB:get_changes(DB), ExpCKData, Note),
  -    true.
  -
  -%% @doc Like check_db/5 but do not check DB using ?TEST_DB:check_db.
  --spec check_db2(DB::?TEST_DB:db(), ExpLoad::integer(),
  -               ExpData::?TEST_DB:db_as_list(), Note::string()) -> true.
  -check_db2(DB, ExpLoad, ExpData, Note) ->
  -    check_db2(DB, ExpLoad, ExpData, {[], []}, Note).
  -
  -%% @doc Like check_db/5 but do not check DB using ?TEST_DB:check_db.
  --spec check_db2(DB::?TEST_DB:db(), ExpLoad::integer(),
  -                ExpData::?TEST_DB:db_as_list(),
  -                ExpCKData::{UpdatedEntries::?TEST_DB:db_as_list(), DeletedKeys::[?RT:key()]},
  -                Note::string()) -> true.
  -check_db2(DB, ExpLoad, ExpData, ExpCKData, Note) ->
  -    ?equals_w_note(?TEST_DB:get_load(DB), ExpLoad, Note),
  -    ?equals_w_note(lists:sort(?TEST_DB:get_data(DB)), lists:sort(ExpData), Note),
  -    ?equals_w_note(?TEST_DB:get_changes(DB), ExpCKData, Note),
  -    true.
  +%% @doc Checks that an entry is present exactly once in the list of changed
  +%%      entries returned by ?TEST_DB:get_changes/1.
  +-spec check_entry_in_changes(
  +        DB::?TEST_DB:db(), ChangesInterval::intervals:interval(), Entry::db_entry:entry(),
  +        {OldExists::boolean(), OldEntry::db_entry:entry()}, Note::string()) -> ok.
  +check_entry_in_changes(DB, ChangesInterval, NewEntry, {OldExists, OldEntry}, Note) ->
  +    {ChangedEntries, DeletedKeys} = ?TEST_DB:get_changes(DB),
  +    case db_entry:is_null(NewEntry) of
  +        true ->
  +            check_key_in_deleted_internal(DeletedKeys, ChangesInterval, db_entry:get_key(NewEntry), OldExists, Note);
  +        _ ->
  +            check_entry_in_changed_entries_internal(ChangedEntries, ChangesInterval, NewEntry, OldEntry, Note)
  +    end.
  
positive.code:     ?equals_w_note(?TEST_DB:get_changes(DB9), {[], []}, "stop_record_changes_11"),
  
      ?TEST_DB:close(DB9),
      true.
  
  get_random_interval_from_changes(DB) ->
  
negative.code: %% @doc Checks that a key is present exactly once in the list of deleted
  %%      keys returned by ?TEST_DB:get_changes/1 if no lock is set on a
  %%      previously existing entry.
  -spec check_key_in_deleted_no_locks(
          DB::?TEST_DB:db(), ChangesInterval::intervals:interval(), Key::?RT:key(),
          {OldExists::boolean(), OldEntry::db_entry:entry()}, Note::string()) -> true.
  check_key_in_deleted_no_locks(DB, ChangesInterval, Key, {OldExists, OldEntry}, Note) ->
      case intervals:in(Key, ChangesInterval) andalso OldExists andalso
               (db_entry:get_writelock(OldEntry) =:= false andalso
                    db_entry:get_readlock(OldEntry) =:= 0) of
          true ->
              {_ChangedEntries, DeletedKeys} = ?TEST_DB:get_changes(DB),
              check_key_in_deleted_internal(DeletedKeys, ChangesInterval, Key, OldExists, Note);
          _    -> true
      end.
  
  