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: tests.rs
    path of file: ./repos/s2n-quic/quic/s2n-quic-transport/src/stream/manager
    
    the code of the file until where you have to start completion: // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//! Tests for `StreamManager`

use super::*;
use crate::{
    connection::{
        self, finalization::Provider, InternalConnectionId, InternalConnectionIdGenerator,
        Limits as ConnectionLimits,
    },
    contexts::{ConnectionApiCallContext, OnTransmitError, WriteContext},
    endpoint,
    recovery::{RttEstimator, DEFAULT_INITIAL_RTT},
    stream::{
        controller::MAX_STREAMS_SYNC_FRACTION,
        manager_api::Manager as _,
        stream_impl::StreamConfig,
        stream_interests::{StreamInterestProvider, StreamInterests},
        testing::*,
        AbstractStreamManager, StreamError, StreamEvents, StreamTrait,
    },
    sync::DEFAULT_SYNC_PERIOD,
    transmission,
    transmission::interest::Provider as TransmissionInterestProvider,
    wakeup_queue::{WakeupHandle, Wakeup
    
fn add_and_remove_streams_from_delivery_notification_window_lists() {
    let mut manager = create_stream_manager(endpoint::Type::Server);

    let stream_1 = try_open(&mut manager, StreamType::Bidirectional).unwrap();
    let stream_2 = try_open(&mut manager, StreamType::Unidirectional).unwrap();
    let _stream_3 = try_open(&mut manager, StreamType::Bidirectional).unwrap();
    let stream_4 = try_open(&mut manager, StreamType::Unidirectional).unwrap();

    for stream_id in &[stream_2, stream_1, stream_4] {
        manager.with_asserted_stream(*stream_id, |stream| {
            stream.interests.delivery_notifications = true;
        });
    }
    assert_eq!(
        [stream_2, stream_1, stream_4],
        *manager.streams_waiting_for_delivery_notifications()
    );

    manager.with_asserted_stream(stream_2, |stream| {
        stream.interests.delivery_notifications = false;
    });
    assert_eq!(
        [stream_1, stream_4],
        *manager.streams_waiting_for_delivery_notifications()
    );

    manager.with_asserted_stream(stream_4, |stream| {
        stream.interests.delivery_notifications = false;
    });
    assert_eq!(
        [stream_1],
        *manager.streams_waiting_for_delivery_notifications()
    );

    manager.with_asserted_stream(stream_1, |stream| {
        stream.interests.delivery_notifications = false;
    });
    assert!(manager
        .streams_waiting_for_delivery_notifications()
        .is_empty());
}