@Override
    public List<Port> getPorts(DeviceId deviceId) {
        checkNotNull(deviceId, DEVICE_NULL);
        return manager.getVirtualPorts(this.networkId, deviceId)
                .stream()
                .collect(Collectors.toList());
    }
@Test
    public void testGetPorts() {
        manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
        VirtualNetwork virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
        VirtualDevice virtualDevice = manager.createVirtualDevice(virtualNetwork.id(), DID1);
        manager.createVirtualDevice(virtualNetwork.id(), DID2);

        DeviceService deviceService = manager.get(virtualNetwork.id(), DeviceService.class);

        ConnectPoint cp = new ConnectPoint(virtualDevice.id(), PortNumber.portNumber(1));

        manager.createVirtualPort(virtualNetwork.id(), virtualDevice.id(), PortNumber.portNumber(1), cp);
        manager.createVirtualPort(virtualNetwork.id(), virtualDevice.id(), PortNumber.portNumber(2), cp);

        // test the getPorts() method
        assertEquals("The port set size did not match.", 2,
                     deviceService.getPorts(DID1).size());
        assertEquals("The port set size did not match.", 0,
                     deviceService.getPorts(DID2).size());
    }