assertNotNull(firstSet);
assertNotNull(secondSet);
assertEquals(1, firstSet.getChildren().size());
IFolderChild child = firstSet.getChildren().iterator().next();
assertTrue(child instanceof IFolder);
assertEquals("Folder A", child.getName());
IFolder folderA = (IFolder) child;
assertEquals(1, folderA.getMarks().size());
assertEquals(1, folderA.getFolders().size());
List<IFolderChild> children = folderA.getChildren();
IBookMark rssowlMark = null;
IFolder bins = null;
for (IFolderChild foo : children) {
if (foo instanceof IBookMark && "RSSOwl - A Java RSS / RDF / Atom Newsreader - May the owl be with you".equals(foo.getName()))
rssowlMark = (IBookMark) foo;
else if (foo instanceof IFolder && "Bins".equals(foo.getName()))
bins = (IFolder) foo;
else
fail();
}
assertNotNull(rssowlMark);
assertNotNull(bins);
assertEquals(1, bins.getChildren().size());
IFolderChild next = bins.getChildren().iterator().next();
assertEquals("Bin A", next.getName());
assertTrue(next instanceof INewsBin);
INewsBin binA = (INewsBin) next;
children = secondSet.getChildren();
assertEquals(4, children.size());
IFolder folderB = null;
IBookMark macOsHints = null;
INewsBin binC = null;
ISearchMark searchA = null;
for (IFolderChild foo : children) {
if (foo instanceof IFolder && "Folder B".equals(foo.getName()))
folderB = (IFolder) foo;
else if (foo instanceof IBookMark && "MacOSXHints.com".equals(foo.getName()))
macOsHints = (IBookMark) foo;
else if (foo instanceof INewsBin && "Bin C".equals(foo.getName()))
binC = (INewsBin) foo;
else if (foo instanceof ISearchMark && "Search A".equals(foo.getName()))
searchA = (ISearchMark) foo;
}
assertEquals(2, searchA.getSearchConditions().size());
List<ISearchCondition> conditions = searchA.getSearchConditions();
for (ISearchCondition condition : conditions) {
if (condition.getField().getId() == INews.LOCATION) {
List<IFolderChild> entities = CoreUtils.toEntities((Long[][]) condition.getValue());
assertEquals(1, entities.size());
assertTrue(entities.contains(folderA));
}
}
assertNotNull(folderB);
assertNotNull(macOsHints);
assertNotNull(binC);
assertNotNull(searchA);
children = folderB.getChildren();
IBookMark golemMark = null;
IFolder bins2 = null;
for (IFolderChild foo : children) {
if (foo instanceof IBookMark && "Golem.de".equals(foo.getName()))
golemMark = (IBookMark) foo;
else if (foo instanceof IFolder && "Bins".equals(foo.getName()))
bins2 = (IFolder) foo;
else
fail();
}
assertNotNull(golemMark);
assertNotNull(bins2);
assertEquals(1, bins2.getChildren().size());
next = bins2.getChildren().iterator().next();
assertEquals("Bin B", next.getName());
assertTrue(next instanceof INewsBin);
INewsBin binB = (INewsBin) next;
assertEquals(6, count(Label.class.getName(), elements));