@Override
    public Iterable<MappingEntry> getMappingEntriesByAppId(Type type, ApplicationId appId) {

        Set<MappingEntry> mappingEntries = Sets.newHashSet();
        for (Device d : deviceService.getDevices()) {
            for (MappingEntry mappingEntry : store.getMappingEntries(type, d.id())) {
                if (mappingEntry.appId() == appId.id()) {
                    mappingEntries.add(mappingEntry);
                }
            }
        }
        return mappingEntries;
    }
@Test
    public void getMappingEntriesByAddId() {
        addMapping(MAP_DATABASE, 1);
        addMapping(MAP_DATABASE, 2);

        assertTrue("should have two mappings",
                Lists.newLinkedList(
                        service.getMappingEntriesByAppId(MAP_DATABASE, appId)).size() == 2);
    }