You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: trie_tests.rs
    path of file: ./repos/nearcore/core/store/src/trie
    
    the code of the file until where you have to start completion: use crate::test_utils::{gen_changes, simpl
    
fn test_reads_with_incomplete_storage() {
    let mut rng = rand::thread_rng();
    for _ in 0..50 {
        let tries = TestTriesBuilder::new().with_shard_layout(1, 2).build();
        let shard_uid = ShardUId { version: 1, shard_id: 0 };
        let trie_changes = gen_changes(&mut rng, 20);
        let trie_changes = simplify_changes(&trie_changes);
        if trie_changes.is_empty() {
            continue;
        }
        let state_root =
            test_populate_trie(&tries, &Trie::EMPTY_ROOT, shard_uid, trie_changes.clone());
        let get_trie = || tries.get_trie_for_shard(shard_uid, state_root);

        {
            let (key, _) = trie_changes.choose(&mut rng).unwrap();
            println!("Testing lookup {:?}", key);
            let lookup_test =
                |trie: Trie| -> Result<_, StorageError> { trie.get(key).map(move |v| (trie, v)) };
            test_incomplete_storage(get_trie(), lookup_test);
        }
        {
            println!("Testing TrieIterator over whole trie");
            let trie_records = |trie: Trie| -> Result<_, StorageError> {
                let iterator = trie.iter()?;
                iterator.collect::<Result<Vec<_>, _>>().map(move |v| (trie, v))
            };
            test_incomplete_storage(get_trie(), trie_records);
        }
        {
            let (key, _) = trie_changes.choose(&mut rng).unwrap();
            let key_prefix = &key[0..rng.gen_range(0..key.len() + 1)];
            println!("Testing TrieUpdateIterator over prefix {:?}", key_prefix);
            let trie_update_keys = |trie: Trie| -> Result<_, StorageError> {
                let trie_update = TrieUpdate::new(trie);
                let keys = trie_update.iter(key_prefix)?.collect::<Result<Vec<_>, _>>()?;
                Ok((trie_update.trie, keys))
            };
            test_incomplete_storage(get_trie(), trie_update_keys);
        }
    }
}