Looks up elements that match given predicate and returns them in a newly
created DefaultContext.

@param pPredicate
The criteria the elements must match to be found.
322907
@Override
	public GenericContext<ElementType> lookup(final Predicate<ElementType> pPredicate) {

		return lookup(pPredicate, Integer.MAX_VALUE, new GenericContext<ElementType>());
	}
1005152
public Set<String> getResources(final Predicate<String> namePredicate) {
        Iterable<String> resources = Iterables.filter(store.get(index(ResourcesScanner.class)).keySet(), namePredicate);
        return Sets.newHashSet(store.get(index(ResourcesScanner.class), resources));
    }
479942
protected void findMatching(Class<? extends T> type, BiPredicate<Class<? extends T>, D> predicate)
	{
		traverseType(type, predicate, new HashSet<>());
	}
1137950
public static boolean matches(PrecedencedSelfDescribing self, Matcher<?> matcher, Object item, Description mismatch) {
        boolean paren = useParen(self, matcher);
        if (paren) {
            return QuickDiagnose.matches(matcher, item, mismatch, "($1)");
        } else {
            return QuickDiagnose.matches(matcher, item, mismatch);
        }
    }
1236394
public synchronized void matchNode(RenderCallback renderCallback, final RenderContext renderContext, PointOfInterest poi) {
        MatchingCacheKey matchingCacheKey = new MatchingCacheKey(poi.tags, renderContext.rendererJob.tile.zoomLevel, Closed.NO);

        List<RenderInstruction> matchingList = this.poiMatchingCache.get(matchingCacheKey);
        if (matchingList != null) {
            // cache hit
            for (int i = 0, n = matchingList.size(); i < n; ++i) {
                matchingList.get(i).renderNode(renderCallback, renderContext, poi);
            }
            return;
        }

        // cache miss
        matchingList = new ArrayList<RenderInstruction>();

        for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
            this.rulesList.get(i).matchNode(renderCallback, renderContext, matchingList, poi);
        }
        this.poiMatchingCache.put(matchingCacheKey, matchingList);
    }
317764
@ParallelSupported
    public Stream<T> distinct(final Predicate<? super Long> occurrencesFilter) {
        final Supplier<? extends Map<T, Long>> supplier = isParallel() ? Suppliers.<T, Long> ofConcurrentHashMap() : Suppliers.<T, Long> ofLinkedHashMap();

        return groupBy(Fn.<T> identity(), Collectors.counting(), supplier).filter(Fn.<T, Long> testByValue(occurrencesFilter)).map(Fn.<T, Long> key());
    }
52048
@Transactional(readOnly = true)
	public Collection<Response> find(SearchCriteria searchCriteria) {
		CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
		CriteriaQuery<Response> criteriaQuery = criteriaBuilder.createQuery(Response.class);
		Root<Response> root = criteriaQuery.from(Response.class);
		
		Collection<Predicate> conditions = new ArrayList<>();
		
		if (searchCriteria.getUser() != null) {
			Predicate userCondition = criteriaBuilder.equal(root.get("user").get("username"), searchCriteria.getUser().getUsername());
			conditions.add(userCondition);
		}
		
		if (searchCriteria.getDetectionSystemIds() != null) {
			Predicate detectionSystemCondition = root.get("detectionSystem").get("detectionSystemId").in(searchCriteria.getDetectionSystemIds());
			conditions.add(detectionSystemCondition);
		}

		if (conditions.size() > 0) {
			criteriaQuery.where(criteriaBuilder.and(conditions.toArray(new Predicate[0])));
		}
		
		criteriaQuery.orderBy(criteriaBuilder.asc(root.get("timestamp")));

		TypedQuery<Response> query = em.createQuery(criteriaQuery); 
		List<Response> result = query.getResultList();
		
		return result;
	}
742932
@Override
    public R visitMemberReference(MemberReferenceTree node, P p) {
        R r = scan(node.getQualifierExpression(), p);
        r = scanAndReduce(node.getTypeArguments(), p, r);
        return r;
    }
742962
public T find(Predicate<T> decision, T defaultValue) {
		return Iterables.find(result(), decision, defaultValue);
	}
730416
function matchDescendant(nodes, predicate) {
  return uniqueReduce(
    (matches, node) => matches.concat(treeFilter(node, predicate)),
    flat(nodes.map(childrenOfNode)),
  );
}
67149
public static <T> Predicate<T> predicate(CheckedPredicate<T> predicate) {
        return predicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
895013
@Override
  public Iterable<BlockTemplateMatch> match(JCTree tree, Context context) {
    // TODO(lowasser): consider nonconsecutive matches?
    if (tree instanceof JCBlock) {
      JCBlock block = (JCBlock) tree;
      ImmutableList<JCStatement> targetStatements = ImmutableList.copyOf(block.getStatements());
      return matchesStartingAnywhere(block, 0, targetStatements, context)
          .first()
          .or(List.<BlockTemplateMatch>nil());
    }
    return ImmutableList.of();
  }
1198732
public static <V> Predicate<TaskContext<V>> ifResult(Predicate<V> predicate) {
        return ctx -> predicate.test(ctx.getResult());
    }
1323819
protected <R> Predicate byMandatoryPredicate(CriteriaQuery<?> criteriaQuery, Root<E> root, CriteriaBuilder builder, E entity, SearchParameters sp) {
        return null;
    }
999100
public Search name(@Nullable Predicate<String> nameMatches) {
        if (nameMatches != null)
            this.nameMatches = nameMatches;
        return this;
    }
397441
def _find_by_nsp(self, browser, criteria, tag, constraints):
        """"""
        return self._filter_elements(
            browser.find_elements_by_ios_predicate(criteria),
            tag, constraints)
82968
def predicate_to_IRI(self, predicate: ShExDocParser.PredicateContext) -> ShExJ.IRIREF:
        
        if predicate.iri():
            return self.iri_to_iriref(predicate.iri())
        else:
            return RDF_TYPE