Returns a predicate that evaluates to true if and only if the input is
equivalent to {@code target} according to this equivalence relation.

@since 10.0
344715
@Beta
  public final Predicate<T> equivalentTo(@Nullable T target) {
    return new EquivalentToPredicate<T>(this, target);
  }
769957
public char match(ISense source, ISense target) throws MatcherLibraryException {
        List<ISense> sourceList = getAncestors(source, depth);
        List<ISense> targetList = getAncestors(target, depth);
        targetList.retainAll(sourceList);
        if (targetList.size() > 0)
            return IMappingElement.EQUIVALENCE;
        else
            return IMappingElement.IDK;
    }
102271
public static <T> Predicate<T> FALSE() {
	return Predicate.<T>NOT(Predicate.<T>TRUE());
    }
1097984
public static <T> Predicate<T> contains(final Iterable<T> iterable) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return Iterables.contains(iterable, testValue);
            }
        };
    }
162225
public static <T> Predicate<T> negate(final Predicate<? super T> predicate) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return !predicate.test(testValue);
            }
        };
    }
1327157
public <T> Predicate<T> be(T value) {
    return create(obj -> Objects.equals(obj, value));
  }
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
1207402
@Nullable
  private static Node getEnclosingTarget(Node targetNode) {
    checkState(checkNotNull(targetNode).isValidAssignmentTarget(), targetNode);
    Node parent = checkNotNull(targetNode.getParent(), targetNode);
    boolean targetIsFirstChild = parent.getFirstChild() == targetNode;
    if (parent.isDefaultValue() || parent.isRest()) {
      // in `([something = targetNode] = x)` targetNode isn't actually acting
      // as a target.
      checkState(targetIsFirstChild, parent);
      // The DEFAULT_VALUE or REST occupies the place where the assignment target it contains would
      // otherwise be in the AST, so pretend it is the target for the logic below.
      targetNode = parent;
      parent = checkNotNull(targetNode.getParent());
      targetIsFirstChild = targetNode == parent.getFirstChild();
    }
    switch (parent.getToken()) {
      case ARRAY_PATTERN:
        // e.g. ([targetNode] = something)
        return parent;

      case OBJECT_PATTERN:
        // e.g. ({...rest} = something);
        return parent;

      case COMPUTED_PROP:
        // e.g. ({[expression]: targetNode} = something)
        // e.g. ({[expression]: targetNode = default} = something)
        // make sure the effective target (targetNode or DEFAULT_VALUE containing it)
        // isn't the expression part
        checkState(!targetIsFirstChild, parent);
        // otherwise the same as STRING_KEY so fall through
      case STRING_KEY:
        // e.g. ({parent: targetNode} = something)
        Node grandparent = checkNotNull(parent.getParent(), parent);
        checkState(grandparent.isObjectPattern(), grandparent);
        return grandparent;

      case PARAM_LIST:
        // e.g. `function foo(targetNode) {}`
      case LET:
      case CONST:
      case VAR:
        // non-destructured declarations
        // e.g. `let targetNode = 3;`
        return null;

      case FUNCTION:
      case CLASS:
        // e.g. `function targetNode() {}`
        // e.g. `class targetNode {}`
        checkState(targetIsFirstChild, targetNode);
        return null;

      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
        // e.g. `for ({length} in obj) {}` // targetNode is `{length}`
        // e.g. `for ({length} of obj) {}` // targetNode is `{length}`
        checkState(targetIsFirstChild, targetNode);
        return null;

      case DESTRUCTURING_LHS:
        // destructured declarations
        // e.g. `let [a] = 3`; // targetNode is `[a]`
        checkState(targetIsFirstChild, targetNode);
        return null;

      case IMPORT:
        // e.g. `import targetNode from './foo/bar';`
        return null;

      case IMPORT_SPEC:
        // e.g. `import {bar as targetNode} from './foo/bar';`
        // e.g. `import {targetNode} from './foo/bar';` // AST will have {targetNode as targetNode}
        checkState(!targetIsFirstChild, parent);
        return null;

      case CATCH:
        // e.g. `try {} catch (foo) {}`
        return null;

      default:
        // e.g. targetNode = something
        checkState(isAssignmentOp(parent) && targetIsFirstChild, parent);
        return null;
    }
  }
1281611
public static <T extends Executable> Predicate<T> executableBelongsToClass(Class<?> reference) {
        return candidate -> candidate != null && reference.equals(candidate.getDeclaringClass());
    }
1339370
private static <X> Predicate<X> isCandidate(final Iterable<List<X>> remainingInputs) {
        return new Predicate<X>() {

            Predicate<List<X>> headIs(final X c) {
                return new Predicate<List<X>>() {
                    public boolean apply(List<X> input) {
                        return !input.isEmpty() && c.equals(input.get(0));
                    }
                };
            }

            Predicate<List<X>> tailContains(final X c) {
                return new Predicate<List<X>>() {
                    public boolean apply(List<X> input) {
                        return input.indexOf(c) > 0;
                    }
                };
             }

             public boolean apply(final X c) {
                 return any(remainingInputs, headIs(c)) &&
                       all(remainingInputs, not(tailContains(c)));
             }
        };
    }
143619
public static <T extends Executable> Predicate<T> executableBelongsToClassAssignableTo(Class<?> reference) {
        return candidate -> candidate != null && reference.isAssignableFrom(candidate.getDeclaringClass());
    }
270446
public static Predicate<Element> shouldGenerateMatcher() {
        return element -> ElementParentsIterable.stream(element)
                .noneMatch(next -> nonNull(next.getAnnotation(DoNotGenerateMatcher.class)));
    }
67149
public static <T> Predicate<T> predicate(CheckedPredicate<T> predicate) {
        return predicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
619151
public static <T> Predicate<T> equalTo(@Nullable T target) {
		return target == null ? isNull() : t -> Objects.equals(t, target);
	}
871069
public boolean matches(String target, int start, int end) {
		return this.matches(target, start, end, (Match) null);
	}
193689
public static @Nonnull Predicate evaluating(final @Nonnull String pattern) {
        return new Predicate() {
            @Override
            public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) {
                for (StackTraceElement element : thread.getStackTrace().getElements()) {
                    if ((element.getClassName() + "." + element.getMethodName()).equals(pattern)) return true;
                }
                return false;
            }
        };
    }
1001967
public boolean is(VectorPredicate predicate) {
        boolean result = true;
        VectorIterator it = iterator();

        while (it.hasNext()) {
            double x = it.next();
            int i = it.index();
            result = result && predicate.test(i, x);
        }

        return result;
    }