@Override
    public Set<DeviceId> getDevices(NetworkId networkId, NodeId nodeId) {
        Map<DeviceId, NodeId> masterMap = getMasterMap(networkId);

        Set<DeviceId> ids = new HashSet<>();
        for (Map.Entry<DeviceId, NodeId> d : masterMap.entrySet()) {
            if (Objects.equals(d.getValue(), nodeId)) {
                ids.add(d.getKey());
            }
        }
        return ids;
    }
@Test
    public void getDevices() {
        Set<DeviceId> d = Sets.newHashSet(VDID1, VDID2);

        put(VNID1, VDID1, N2, true, true);
        put(VNID1, VDID2, N2, true, true);
        put(VNID1, VDID3, N1, true, true);
        assertTrue("wrong devices", d.equals(sms.getDevices(VNID1, N2)));
    }