code: private List<NodeEntity> filterNodes(List<NodeEntity> nodes)
      {
          List<NodeEntity> filteredNodes= null;
          
          //Filter by sites
          Map<String,Boolean> filters=getFilters();
          
          if(filters.values().contains(Boolean.TRUE)){
              
              filteredNodes= new ArrayList<NodeEntity>();
              
              for(NodeEntity node:nodes){
                  
                 boolean shouldBeAdded=true;
                 NodeRef nodeRef= new NodeRef(node.getStore().getStoreRef(),node.getUuid());
                 String nodeType="{"+node.getTypeNamespace()+"}"+node.getTypeName();
                      
                 if(nodeService.exists(nodeRef)){
                      
                      //Filter by site
                      if(filters.get(SITES_FILTER)){
                          Path pathObj = nodeService.getPath(nodeRef);
                          String siteName = Utils.getSiteName(pathObj);
                          shouldBeAdded= siteName!=null && this.sites.contains(siteName);
                      }
                      
                      //Filter by properties
                      if(filters.get(PROPERTIES_FILTER) && shouldBeAdded){
                          for(String prop:this.properties){
                              
                              int pos=prop.lastIndexOf(":");
                              String qName=null;
                              String value=null;
                              
                              if(pos!=-1 && (prop.length()-1)>pos){
                                  qName=prop.substring(0, pos);
                                  value= prop.substring(pos+1,prop.length());
                              }
                              
                              if(StringUtils.isEmpty(qName) || StringUtils.isEmpty(value)){
                                  //Invalid property
                                  continue;
                              }
                              
                              Serializable rawValue= nodeService.getProperty(nodeRef, QName.createQName(qName));
                              shouldBeAdded=shouldBeAdded && value.equals(rawValue);
                              
                          }
                      }
                      
                      
                  }
                 else if(nodeType.equals(ContentModel.TYPE_DELETED.toString())){
                     shouldBeAdded=Boolean.TRUE;
                 }
                 if(shouldBeAdded){
                     filteredNodes.add(node);
                 }
              }
          }else{
              filteredNodes=nodes;
          }
          return filteredNodes;
      }
docs: Filter the nodes based on some parameters
  @param nodes
  @return