@Override
    public void emit(NetworkId networkId, OutboundPacket packet) {
       devirtualize(networkId, packet)
               .forEach(outboundPacket -> packetService.emit(outboundPacket));
    }
@Test
    public void devirtualizePacket() {
        TrafficTreatment tr = DefaultTrafficTreatment.builder()
                .setOutput(VPORT_NUM1).build();
        ByteBuffer data = ByteBuffer.wrap("abc".getBytes());

        OutboundPacket vOutPacket = new DefaultOutboundPacket(VDID, tr, data);

        virtualProvider.emit(VNET_ID, vOutPacket);

        assertEquals("The count should be 1", 1,
                     testPacketService.getRequestedPacketCount());

        OutboundPacket pOutPacket = testPacketService.getRequestedPacket(0);

        assertEquals("The packet should be requested on DEV1", DID1,
                     pOutPacket.sendThrough());

        PortNumber outPort = pOutPacket.treatment()
                .allInstructions()
                .stream()
                .filter(i -> i.type() == Instruction.Type.OUTPUT)
                .map(i -> (Instructions.OutputInstruction) i)
                .map(i -> i.port())
                .findFirst().get();
        assertEquals("The packet should be out at PORT1 of DEV1", PORT_NUM1,
                     outPort);
    }