### Question:
AttachmentHandler implements AttachmentService.Iface { @Override public AttachmentUsage updateAttachmentUsage(AttachmentUsage attachmentUsage) throws TException { assertNotNull(attachmentUsage); assertId(attachmentUsage.getId()); return handler.updateAttachmentUsage(attachmentUsage); } 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 testUpdateAttachmentUsage() throws Exception { AttachmentUsage usage1 = new AttachmentUsage(); usage1.setOwner(Source.projectId("r1")); usage1.setUsedBy(Source.projectId("p1")); usage1.setAttachmentContentId("a1"); handler.makeAttachmentUsage(usage1); usage1.setUsageData(UsageData.licenseInfo(new LicenseInfoUsage(Sets.newHashSet("l1", "l2")))); handler.updateAttachmentUsage(usage1); Assert.assertThat(handler.getAttachmentUsage(usage1.getId()), is(usage1)); }