NewsReference newsRef = new NewsReference(DynamicDAO.save(fFactory.createNews(null, feedRef.resolve(), new Date())).getId());
IAttachment attachment = fFactory.createAttachment(null, newsRef.resolve());
attachment.setLink(new URI("http://www.attachment.com"));
final boolean attachmentEvents[] = new boolean[3];
final AttachmentReference attachmentReference[] = new AttachmentReference[1];
attachmentListener = new AttachmentAdapter() {
@Override
public void entitiesAdded(Set<AttachmentEvent> events) {
for (AttachmentEvent event : events) {
assertTrue("Expected this Event to be Root Event", event.isRoot());
attachmentEvents[0] = true;