ISearchField locationField = fFactory.createSearchField(INews.LOCATION, INews.class.getName());
ISearchCondition condition1 = fFactory.createSearchCondition(locationField, SearchSpecifier.IS, ModelUtils.toPrimitive(Collections.singletonList(subRoot)));
ISearchCondition condition2 = fFactory.createSearchCondition(locationField, SearchSpecifier.IS, ModelUtils.toPrimitive(Collections.singletonList(bin)));
ISearchMark sm = fFactory.createSearchMark(null, root, "Search");
sm.addSearchCondition(condition1);
sm.addSearchCondition(condition2);
DynamicDAO.save(root);
Long folderId = subRoot.getId();
Long binId = bin.getId();
root = null;
locationField = null;
condition1 = null;
condition2 = null;
sm = null;
subRoot = null;
bin = null;
Runtime.getRuntime().gc();
Owl.getPersistenceService().shutdown(false);
Owl.getPersistenceService().startup(new NullProgressLongOperationMonitor());
Collection<ISearchMark> sms = DynamicDAO.loadAll(ISearchMark.class);
assertEquals(1, sms.size());
sm = sms.iterator().next();
assertEquals(2, sm.getSearchConditions().size());
List<ISearchCondition> conditions = sm.getSearchConditions();
boolean foundFolder = false;
boolean foundBin = false;
for (ISearchCondition condition : conditions) {
assertNotNull(condition.getValue());