Set<SavedSearch> savedSearches = new HashSet<SavedSearch>();
for (int i = 0; i < 50; i++) {
String iStr = i > 9 ? String.valueOf(i) : "0" + String.valueOf(i);
if (i < 25) {
resources.add(SessionTestHelper.createNewResource(em, "resource-" + iStr, resourceType));
SavedSearch savedSearch = new SavedSearch(SearchSubsystem.RESOURCE, "search-" + iStr,
"resource-" + iStr, searchesOwner);
savedSearchManager.createSavedSearch(searchesOwner, savedSearch);
savedSearches.add(savedSearch);
} else {
resourceGroups.add(SessionTestHelper.createNewCompatibleGroupForRole(em, searchesOwnerRole,
"group-" + iStr, resourceType));
SavedSearch savedSearch = new SavedSearch(SearchSubsystem.GROUP, "search-" + iStr, "group-"
+ iStr, searchesOwner);
savedSearchManager.createSavedSearch(searchesOwner, savedSearch);
savedSearches.add(savedSearch);
}
}