### Question:
CitationManager implements ICitationManager { @Override public ICitation getCitation(IUser user, String groupId, String key) throws GroupDoesNotExistException, CannotFindCitationException, ZoteroHttpStatusException { Optional<ICitation> optional = citationRepository.findByKey(key); if (optional.isPresent()) { ICitation citation = optional.get(); ICitationGroup group = groupManager.getGroup(user, groupId); if (group != null && group.getGroupId() == new Long(groupId)) { if (!group.getUsers().contains(user.getUsername())) { if (!group.getUsers().contains(user.getUsername())) { throw new AccessForbiddenException("User does not have access this citation."); } } return citation; } return null; } return updateCitationFromZotero(user, groupId, key); }  @PostConstruct void init(); @Override ICitation getCitation(IUser user, String groupId, String key); @Override ICitation getCitationFromZotero(IUser user, String groupId, String key); @Override void updateCitation(IUser user, String groupId, ICitation citation); @Override ICitation createCitation(IUser user, String groupId, List<String> collectionIds, ICitation citation); @Override ICitation updateCitationFromZotero(IUser user, String groupId, String itemKey); @Override List<ICitationGroup> getGroups(IUser user); @Override @SuppressWarnings("unchecked") CloseableIterator<ICitation> getAllGroupItems(IUser user, String groupId, String collectionId); @Override CitationResults getGroupItems(IUser user, String groupId, String collectionId, int page, String sortBy); @Override void forceGroupItemsRefresh(IUser user, String groupId, String collectionId, int page, String sortBy); @Override List<BibField> getItemTypeFields(IUser user, ItemType itemType); @Override List<String> getValidCreatorTypes(IUser user, ItemType itemType); @Override CitationPage getPrevAndNextCitation(IUser user, String groupId, String collectionId, int page, String sortBy,
            int index);  }### Answer:
@Test public void test_getCitation_inDb() throws GroupDoesNotExistException, CannotFindCitationException, ZoteroHttpStatusException { ICitation actual = managerToTest.getCitation(user, GROUP_ID, EXISTING_ID); Assert.assertNotNull(actual); Assert.assertEquals(EXISTING_ID, actual.getKey()); }
@Test public void test_getCitation_inZotero() throws GroupDoesNotExistException, CannotFindCitationException, ZoteroHttpStatusException { ICitation actual = managerToTest.getCitation(user, GROUP_ID, ZOTERO_CITATION_ID); Assert.assertNotNull(actual); Assert.assertEquals(ZOTERO_CITATION_ID, actual.getKey()); }