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: lib.rs
    path of file: ./repos/nox/crates/waiting-queues/src
    
    the code of the file until where you have to start completion: /*
 * Copyright 2020 Fluence Labs Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#![warn(rust_2018_idioms)]
#![deny(
    dead_c
    
    fn remove_with() {
        let mut q: WaitingQueues<String, String> = WaitingQueues::new();

        let k = "key".to_string();
        let len = 10;

        for i in 0..len {
            q.enqueue(k.clone(), format!("value_bad_{i}"));
            q.enqueue(k.clone(), format!("value_good_{i}"));
        }

        let removed: Vec<_> = q.remove_with(k.clone(), |v| v.contains("bad")).collect();

        assert_eq!(removed.len(), len);
        assert!(
            removed.iter().all(|v| v.contains("bad")),
            "all removed elements should be bad"
        );

        let remaining = q.map.get(&k).unwrap().iter().collect::<Vec<_>>();
        assert_eq!(remaining.len(), len);
        assert!(
            remaining.iter().all(|v| v.contains("good")),
            "all remaining elements should be good"
        );
        drop(remaining); // don't hold reference to q

        let removed = q.remove_with(k.clone(), |_| true).collect::<Vec<_>>();
        assert!(
            removed.iter().all(|v| v.contains("good")),
            "all removed elements should be good"
        );

        assert!(
            matches!(q.enqueue(k, "new".into()), Enqueued::New),
            "all elements removed, queue must be empty"
        );
    }