### Question:
FactManager implements LifecycleAspect { public Iterator<FactEntity> getFacts(List<UUID> id) { if (CollectionUtils.isEmpty(id)) return Collections.emptyIterator(); return new MultiFetchIterator<>(partition -> factDao.fetchByID(partition).iterator(), id); } @Inject  FactManager(ClusterManager clusterManager); @Override void startComponent(); @Override void stopComponent(); FactTypeEntity getFactType(UUID id); FactTypeEntity getFactType(String name); List<FactTypeEntity> fetchFactTypes(); FactTypeEntity saveFactType(FactTypeEntity type); FactEntity getFact(UUID id); Iterator<FactEntity> getFacts(List<UUID> id); FactEntity saveFact(FactEntity fact); FactEntity refreshFact(UUID id); FactEntity retractFact(UUID id); List<FactAclEntity> fetchFactAcl(UUID id); FactAclEntity saveFactAclEntry(FactAclEntity entry); List<FactCommentEntity> fetchFactComments(UUID id); FactCommentEntity saveFactComment(FactCommentEntity comment); List<MetaFactBindingEntity> fetchMetaFactBindings(UUID id); MetaFactBindingEntity saveMetaFactBinding(MetaFactBindingEntity binding);  }### Answer:
@Test public void testFetchFactsById() { FactTypeEntity type = createAndSaveFactType(); FactEntity expected = createAndSaveFact(type.getId(), "value"); createAndSaveFact(type.getId(), "ignored"); List<FactEntity> actual = ListUtils.list(getFactManager().getFacts(ListUtils.list(expected.getId()))); assertEquals(1, actual.size()); assertFact(expected, actual.get(0)); }
@Test public void testFetchFactsByIdWithUnknownId() { assertEquals(0, ListUtils.list(getFactManager().getFacts(null)).size()); assertEquals(0, ListUtils.list(getFactManager().getFacts(ListUtils.list())).size()); assertEquals(0, ListUtils.list(getFactManager().getFacts(ListUtils.list(UUID.randomUUID()))).size()); }