private void searchInResources(String filter) {
   Map<Class<?>, List<Resource>> mapResources = databaseSnapshots.snapshotMapResources();
   for (Class<?> className : mapResources.keySet()) {
     for (Resource resource : mapResources.get(className)) {
       String name = StringUtils.deleteWhitespace(resource.getName().toLowerCase());
       if (name.contains(filter)) {
         addResource(className, resource);
         if ((filter.length() < 3) && (getListMatching().size() > 9)) {
           return;
         }
       }
     }
   }
 }
 private List<FilterPair> fillWithFirstTenFiltersResources() {
   Map<Class<?>, List<Resource>> mapResources = databaseSnapshots.snapshotMapResources();
   Iterator<Class<?>> iteratorClass = mapResources.keySet().iterator();
   while (iteratorClass.hasNext() && getListMatching().size() < 10) {
     Class<?> className = iteratorClass.next();
     for (int i = 0;
         getListMatching().size() < 10 && i < mapResources.get(className).size();
         i++) {
       Resource resource = mapResources.get(className).get(i);
       addResource(className, resource);
     }
   }
   return getListMatching();
 }