public NetworkId networkId() {
        return networkId;
    }
@Test
    public void testEquality() {
        DefaultVirtualDevice device1 =
                new DefaultVirtualDevice(NetworkId.networkId(0), DID1);
        DefaultVirtualDevice device2 =
                new DefaultVirtualDevice(NetworkId.networkId(0), DID2);

        ConnectPoint cpA = new ConnectPoint(device1.id(), PortNumber.portNumber(1));
        ConnectPoint cpB = new ConnectPoint(device1.id(), PortNumber.portNumber(2));
        ConnectPoint cpC = new ConnectPoint(device2.id(), PortNumber.portNumber(2));

        DefaultVirtualPort port1 =
                new DefaultVirtualPort(NetworkId.networkId(0), device1,
                                       PortNumber.portNumber(1), cpA);
        DefaultVirtualPort port2 =
                new DefaultVirtualPort(NetworkId.networkId(0), device1,
                                       PortNumber.portNumber(1), cpA);
        DefaultVirtualPort port3 =
                new DefaultVirtualPort(NetworkId.networkId(0), device1,
                                       PortNumber.portNumber(2), cpB);
        DefaultVirtualPort port4 =
                new DefaultVirtualPort(NetworkId.networkId(1), device2,
                                       PortNumber.portNumber(2), cpC);


        new EqualsTester().addEqualityGroup(port1, port2).addEqualityGroup(port3)
                .addEqualityGroup(port4).testEquals();
    }