WidgetRepository extends AbstractRepository<Widget> { public List<Widget> getByIds(Set<String> widgetIds) { List<Widget> result = new ArrayList<>(); for (String widgetId : widgetIds) { result.add(get(widgetId)); } return result; } @Inject  WidgetRepository(
            @Named("widgetPath") Path path,
            @Named("widgetFileBasedPersister") JsonFileBasedPersister<Widget> fileBasedRepository,
            @Named("widgetFileBasedLoader") JsonFileBasedLoader<Widget> widgetLoader,
            BeanValidator validator,
            Watcher watcher); @Override String getComponentName(); @Override void delete(String widgetId); Widget create(Widget widget); List<Widget> getByIds(Set<String> widgetIds); List<Property> addProperty(String widgetId, Property property); List<Property> updateProperty(String widgetId, String propertyName, Property property); List<Property> deleteProperty(String widgetId, String propertyName);  }
@Test public void should_find_widget_by_id() throws Exception { Widget input = aWidget().id("input").build(); Widget label = aWidget().id("label").build(); addToRepository(input, label); assertThat(widgetRepository.getByIds(Sets.newHashSet("input", "label"))).hasSize(2) .extracting("id").containsOnly("input", "label"); }