<feature/sync-engine> add test to insertOrReplace segments #138