@Test
public void testDeleteAttachmentsDifference() throws Exception {

    Attachment a1 = mock(Attachment.class);
    when(a1.getAttachmentContentId()).thenReturn("a1cid");
    when(a1.getSha1()).thenReturn(null);
    when(a1.isSetSha1()).thenReturn(false);
    Attachment a2 = mock(Attachment.class);
    when(a2.getAttachmentContentId()).thenReturn("a2cid");
    when(a2.getSha1()).thenReturn(null);
    when(a2.isSetSha1()).thenReturn(false);
    Set<Attachment> before = new HashSet<>();
    before.add(a1);
    before.add(a2);
    Attachment a3 = mock(Attachment.class);
    when(a3.getAttachmentContentId()).thenReturn("a1cid");
    when(a3.getSha1()).thenReturn("sha1");
    when(a3.isSetSha1()).thenReturn(true);
    Set<Attachment> after = new HashSet<>();
    after.add(a3);
    Set<String> deletedIds = new HashSet<>();
    deletedIds.add("a2cid");
    attachmentConnector.deleteAttachmentDifference(before, after);
    verify(connector).deleteIds(deletedIds, AttachmentContent.class);
}