fTypesFactory.createGuid(news, "http://www.link.com", true);
DynamicDAO.save(feed);
IFolder folder = fTypesFactory.createFolder(null, null, "Folder");
fTypesFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark");
INewsBin newsBin = fTypesFactory.createNewsBin(null, folder, "NewsBin");
DynamicDAO.save(folder);
INews newsCopy = fTypesFactory.createNews(news, newsBin);
DynamicDAO.save(newsCopy);
DynamicDAO.save(newsBin);
fNewsDAO.setState(Collections.singleton(newsCopy), INews.State.HIDDEN, false, false);
assertEquals(1, newsBin.getNewsRefs().size());
assertEquals(1, newsBin.getNewsRefs(EnumSet.of(INews.State.HIDDEN)).size());
assertEquals(0, newsBin.getNewsRefs(EnumSet.of(INews.State.NEW)).size());
assertEquals(newsCopy, newsBin.getNews().get(0));
fNewsDAO.setState(Collections.singleton(newsCopy), INews.State.DELETED, false, false);
assertEquals(0, newsBin.getNewsRefs().size());
assertNull(fNewsDAO.load(newsCopy.getId()));
}