### Question:
AttachmentHandler implements AttachmentService.Iface { @Override public List<AttachmentUsage> getAttachmentUsages(Source owner, String attachmentContentId, UsageData filter) throws TException { return getAttachmentsUsages(owner, Collections.singleton(attachmentContentId), filter); } AttachmentHandler(); @Override AttachmentContent makeAttachmentContent(AttachmentContent attachmentContent); @Override List<AttachmentContent> makeAttachmentContents(List<AttachmentContent> attachmentContents); @Override AttachmentContent getAttachmentContent(String id); @Override void updateAttachmentContent(AttachmentContent attachment); @Override RequestSummary bulkDelete(List<String> ids); @Override RequestStatus deleteAttachmentContent(String attachmentId); @Override RequestSummary vacuumAttachmentDB(User user, Set<String> usedIds); @Override String getSha1FromAttachmentContentId(String attachmentContentId); @Override AttachmentUsage makeAttachmentUsage(AttachmentUsage attachmentUsage); @Override void makeAttachmentUsages(List<AttachmentUsage> attachmentUsages); @Override AttachmentUsage getAttachmentUsage(String id); @Override AttachmentUsage updateAttachmentUsage(AttachmentUsage attachmentUsage); @Override void updateAttachmentUsages(List<AttachmentUsage> attachmentUsages); @Override void deleteAttachmentUsage(AttachmentUsage attachmentUsage); @Override void deleteAttachmentUsages(List<AttachmentUsage> attachmentUsages); @Override void deleteAttachmentUsagesByUsageDataType(Source usedBy, UsageData usageData); @Override List<AttachmentUsage> getAttachmentUsages(Source owner, String attachmentContentId, UsageData filter); @Override List<AttachmentUsage> getAttachmentsUsages(Source owner, Set<String> attachmentContentIds, UsageData filter); @Override List<AttachmentUsage> getUsedAttachments(Source usedBy, UsageData filter); @Override void replaceAttachmentUsages(Source usedBy, List<AttachmentUsage> attachmentUsages); @Override Map<Map<Source, String>, Integer> getAttachmentUsageCount(Map<Source, Set<String>> attachments, UsageData filter); @Override List<Attachment> getAttachmentsByIds(Set<String> ids); @Override List<Attachment> getAttachmentsBySha1s(Set<String> sha1s); @Override List<Source> getAttachmentOwnersByIds(Set<String> ids); @Override List<AttachmentUsage> getAttachmentUsagesByReleaseId(String releaseId);  }### Answer:
@Test public void testGetAttachmentUsages() throws Exception { AttachmentUsage usage1 = createUsage("p1", "r1", "a11"); AttachmentUsage usage2 = createUsage("p1", "r1", "a12"); AttachmentUsage usage3 = createUsage("p2", "r2", "a21"); AttachmentUsage usage4 = createUsage("p3", "r1", "a11"); AttachmentUsage usage5 = createUsage("p4", "r1", "a11"); handler.makeAttachmentUsages(Lists.newArrayList(usage1, usage2, usage3, usage4, usage5)); Assert.assertThat(handler.getAttachmentUsages(Source.releaseId("r1"), "a11", null), Matchers.containsInAnyOrder(usage1, usage4, usage5)); }