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: track_local_static_test.rs
    path of file: ./repos/webrtc/webrtc/src/track/track_local
    
    the code of the file until where you have to start completion: use std::sync::Arc;

use bytes::Bytes;
use tokio::sync::{mpsc, Mutex};

use super::track_local_static_rtp::*;
use super::track_local_static_sample::*;
use super::*;
use crate::api::media_engine::{MediaEngine, MIME_TYPE_VP8};
use crate::api::APIBuilder;
use crate::peer_connection::configuration::RTCConfiguration;
use crate::peer_connection::peer_connection_test::*;

// If a remote doesn't support a Codec used by a `TrackLocalStatic`
// an error should be returned to the user
#[tokio::test]
async fn test_track_local_static_no_codec_intersection() -> Result<()> {
    let track: Arc<dyn TrackLocal + Send + Sync> = Arc::new(TrackLocalStaticSample::new(
        RTCRtpCodecCapability {
            mime_type: "video/vp8".to_owned(),
            ..Default::default()
        },
        "video".to_owned(),
        "webrtc-rs".to_owned(),
    ));

    let mut m = MediaEngine::default();
    m.register_default_codecs()?;
    let api = APIBuilder::new().with_media_engine(m).build();

    //"Offerer"
    {
        let mut pc = api.new_peer_connection(RTCConfiguration::default()).await?;

        let mut no_codec_pc = APIBuilder::new()
            .build()
            .new_peer_connection(RTCConfiguration::default())
            .await?;

        pc.add_track(Arc::clone(&track)).await?;

        if let Err(err) = signal_pair(&mut pc, &mut no_codec_pc).await {
            assert_eq!(err, Error::ErrUnsupportedCodec);
        } else {
            panic!();
        }

        close_pair_now(&no_codec_pc, &pc).await;
    }

    //"Answerer"
    {
        let mut pc = api.new_peer_connection(RTCConfiguration::default()).await?;

        let mut m = MediaEngine::default();
        m.register_codec(
            RTCRtpCodecParameters {
                capability: RTCRtpCodecCapability {
                    mime_type: "video/VP
    
async fn test_track_local_static_no_codec_intersection() -> Result<()> {
    let track: Arc<dyn TrackLocal + Send + Sync> = Arc::new(TrackLocalStaticSample::new(
        RTCRtpCodecCapability {
            mime_type: "video/vp8".to_owned(),
            ..Default::default()
        },
        "video".to_owned(),
        "webrtc-rs".to_owned(),
    ));

    let mut m = MediaEngine::default();
    m.register_default_codecs()?;
    let api = APIBuilder::new().with_media_engine(m).build();

    //"Offerer"
    {
        let mut pc = api.new_peer_connection(RTCConfiguration::default()).await?;

        let mut no_codec_pc = APIBuilder::new()
            .build()
            .new_peer_connection(RTCConfiguration::default())
            .await?;

        pc.add_track(Arc::clone(&track)).await?;

        if let Err(err) = signal_pair(&mut pc, &mut no_codec_pc).await {
            assert_eq!(err, Error::ErrUnsupportedCodec);
        } else {
            panic!();
        }

        close_pair_now(&no_codec_pc, &pc).await;
    }

    //"Answerer"
    {
        let mut pc = api.new_peer_connection(RTCConfiguration::default()).await?;

        let mut m = MediaEngine::default();
        m.register_codec(
            RTCRtpCodecParameters {
                capability: RTCRtpCodecCapability {
                    mime_type: "video/VP9".to_owned(),
                    clock_rate: 90000,
                    channels: 0,
                    sdp_fmtp_line: "".to_owned(),
                    rtcp_feedback: vec![],
                },
                payload_type: 96,
                ..Default::default()
            },
            RTPCodecType::Video,
        )?;
        let mut vp9only_pc = APIBuilder::new()
            .with_media_engine(m)
            .build()
            .new_peer_connection(RTCConfiguration::default())
            .await?;

        vp9only_pc
            .add_transceiver_from_kind(RTPCodecType::Video, None)
            .await?;

        pc.add_track(Arc::clone(&track)).await?;

        if let Err(err) = signal_pair(&mut vp9only_pc, &mut pc).await {
            assert_eq!(
                err,
                Error::ErrUnsupportedCodec,
                "expected {}, but got {}",
                Error::ErrUnsupportedCodec,
                err
            );
        } else {
            panic!();
        }

        close_pair_now(&vp9only_pc, &pc).await;
    }

    //"Local"
    {
        let (mut offerer, mut answerer) = new_pair(&api).await?;

        let invalid_codec_track = TrackLocalStaticSample::new(
            RTCRtpCodecCapability {
                mime_type: "video/invalid-codec".to_owned(),
                ..Default::default()
            },
            "video".to_owned(),
            "webrtc-rs".to_owned(),
        );

        offerer.add_track(Arc::new(invalid_codec_track)).await?;

        if let Err(err) = signal_pair(&mut offerer, &mut answerer).await {
            assert_eq!(err, Error::ErrUnsupportedCodec);
        } else {
            panic!();
        }

        close_pair_now(&offerer, &answerer).await;
    }

    Ok(())
}