@Override
    public Iterable<Device> getDevices() {
        return manager.getVirtualDevices(
                this.networkId).stream().collect(Collectors.toSet());
    }
@Test
    public void testGetDevices() {
        manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
        VirtualNetwork virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
        VirtualDevice device1 = manager.createVirtualDevice(virtualNetwork.id(), DID1);
        VirtualDevice device2 = manager.createVirtualDevice(virtualNetwork.id(), DID2);

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

        // test the getDevices() method
        Iterator<Device> it = deviceService.getDevices().iterator();
        assertEquals("The device set size did not match.", 2, Iterators.size(it));

        // test the getAvailableDevices() method
        Iterator<Device> it2 = deviceService.getAvailableDevices().iterator();
        assertEquals("The device set size did not match.", 2, Iterators.size(it2));

        // test the getDeviceCount() method
        assertEquals("The device set size did not match.", 2, deviceService.getDeviceCount());

        // test the getDevice() method
        assertEquals("The expect device did not match.", device1,
                     deviceService.getDevice(DID1));
        assertNotEquals("The expect device should not have matched.", device1,
                        deviceService.getDevice(DID2));

        // test the isAvailable() method
        assertTrue("The expect device availability did not match.",
                   deviceService.isAvailable(DID1));
        assertFalse("The expect device availability did not match.",
                    deviceService.isAvailable(DID3));
    }