Matches if the given matcher matches all of/any of the arguments to this method invocation.
188710
public static MultiMatcher<MethodInvocationTree, ExpressionTree> hasArguments(
      MatchType matchType, Matcher<ExpressionTree> argumentMatcher) {
    return new HasArguments(matchType, argumentMatcher);
  }
1333215
public static <T extends Tree, V extends Tree> Matcher<T> contains(
      Class<V> clazz, Matcher<V> treeMatcher) {
    final Matcher<Tree> contains = new Contains(toType(clazz, treeMatcher));
    return contains::matches;
  }
866369
public boolean matches(String string) {		
		Matcher matcher = pattern.matcher(string);
		boolean result = matcher.matches();
		return result;		
	}
661939
private static boolean hasMatch(String[] typeParams, String... type) {
    boolean matches = false;
    for(String t : type) {
      for(String typeParam : typeParams) {
        if(typeParam.contains("/")) {
          String typePart = typeParam.replace("*", "");
          if(t.startsWith(typePart) || t.endsWith(typePart)) {
            matches = true;
            break;
          }
        } else if(t.equals(typeParam)) {
          matches = true;
          break;
        }
      }
      if(matches) {
        break;
      }
    }
    return matches;
  }
667153
@Override
  public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
    MatchResult directResult = firstNonNullMatchResult(DIRECT_MATCHERS, tree, state);
    MatchResult typeArgResult = null;
    if (directResult == null) {
      typeArgResult = firstNonNullMatchResult(TYPE_ARG_MATCHERS, tree, state);
    }
    if (directResult == null && typeArgResult == null) {
      return Description.NO_MATCH;
    }
    Verify.verify(directResult == null ^ typeArgResult == null);
    MatchResult result = MoreObjects.firstNonNull(directResult, typeArgResult);

    Types types = state.getTypes();
    TypeCompatibilityReport compatibilityReport =
        EqualsIncompatibleType.compatibilityOfTypes(
            result.targetType(), result.sourceType(), state);
    if (compatibilityReport.compatible()) {
      return Description.NO_MATCH;
    }

    // For error message, use simple names instead of fully qualified names unless they are
    // identical.
    String sourceTreeType = Signatures.prettyType(ASTHelpers.getType(result.sourceTree()));
    String sourceType = Signatures.prettyType(result.sourceType());
    String targetType = Signatures.prettyType(result.targetType());
    if (sourceType.equals(targetType)) {
      sourceType = result.sourceType().toString();
      targetType = result.targetType().toString();
    }

    Description.Builder description = buildDescription(tree);
    if (typeArgResult != null) {
      description.setMessage(
          String.format(
              "Argument '%s' should not be passed to this method; its type %s has a type argument "
                  + "%s that is not compatible with its collection's type argument %s",
              result.sourceTree(), sourceTreeType, sourceType, targetType));
    } else {
      description.setMessage(
          String.format(
              "Argument '%s' should not be passed to this method; its type %s is not compatible "
                  + "with its collection's type argument %s",
              result.sourceTree(), sourceType, targetType));
    }

    switch (fixType) {
      case PRINT_TYPES_AS_COMMENT:
        description.addFix(
            SuggestedFix.prefixWith(
                tree,
                String.format(
                    "/* expected: %s, actual: %s */",
                    ASTHelpers.getUpperBound(result.targetType(), types), result.sourceType())));
        break;
      case CAST:
        Fix fix;
        if (typeArgResult != null) {
          TypeArgOfMethodArgMatcher matcher = (TypeArgOfMethodArgMatcher) typeArgResult.matcher();
          String fullyQualifiedType = matcher.getMethodArgTypeName();
          String simpleType = Iterables.getLast(Splitter.on('.').split(fullyQualifiedType));
          fix =
              SuggestedFix.builder()
                  .prefixWith(result.sourceTree(), String.format("(%s<?>) ", simpleType))
                  .addImport(fullyQualifiedType)
                  .build();
        } else {
          fix = SuggestedFix.prefixWith(result.sourceTree(), "(Object) ");
        }
        description.addFix(fix);
        break;
      case SUPPRESS_WARNINGS:
        SuggestedFix.Builder builder = SuggestedFix.builder();
        builder.prefixWith(
            result.sourceTree(),
            String.format("/* expected: %s, actual: %s */ ", targetType, sourceType));
        addSuppressWarnings(builder, state, "CollectionIncompatibleType");
        description.addFix(builder.build());
        break;
      case NONE:
        break;
    }

    return description.build();
  }
758011
private static boolean isMatchesMethod(Method method) {
        if (method.getParameterTypes().length != 1) {
            return false;
        }
        if (method.isBridge()) {
            return false;
        }
        return "matches".equals(method.getName());
    }
1368126
public static Matcher<String> containsPatterns(String... patterns) {
        List<Matcher<? super String>> matchers = new ArrayList<Matcher<? super String>>();
        for (String pattern : patterns) {
            matchers.add(pattern(pattern));
        }
        return allOf(matchers);
    }
222676
@Override
  public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
    if (!HAS_MUST_BE_CLOSED_ANNOTATION.matches(tree, state)) {
      return NO_MATCH;
    }
    if (CONSTRUCTOR.matches(tree, state)) {
      return NO_MATCH;
    }
    return matchNewClassOrMethodInvocation(tree, state);
  }
1358629
protected String getMatcherString(MatchType matchType, String paramName) {
    String matchB;
    if (matchType == MatchType.DECOMPOSE || matchType == MatchType.ANY) {
      matchB = "any()";
    } else {
      matchB = "eq(" + paramName + ".t)";
    }
    return matchB;
  }
195777
private boolean checkMatch() {
        if (matchList == null) {
            return true;
        }
        final int matchSize = matchList.size();
        final int ancestorSize = topicIdList.size();
        final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
        return matchList.equals(tail);
    }
340992
@Override
    public boolean allMatch($.Function<? super T, Boolean> predicate) {
        return !anyMatch($.F.negate(predicate));
    }
193508
public static boolean matches(Pattern patternMatcher, Collection<Filter> filters, Extension extension)
    {
        if (matches(patternMatcher, extension.getId().getId(), extension.getDescription(), extension.getSummary(),
            extension.getName(), ExtensionIdConverter.toStringList(extension.getExtensionFeatures()))) {
            for (Filter filter : filters) {
                if (!matches(filter, extension)) {
                    return false;
                }
            }

            return true;
        }

        return false;
    }
455055
static Matcher inlineMatchAnyPrecedingOr(Matcher matcher) {
    if (matcher instanceof ZeroOrMoreMatcher) {
      ZeroOrMoreMatcher zm = matcher.as();
      if (zm.repeated() instanceof AnyMatcher && zm.next() instanceof OrMatcher) {
        List<Matcher> matchers = zm.next().<OrMatcher>as().matchers();
        List<Matcher> ms = new ArrayList<>();
        for (Matcher m : matchers) {
          ms.add(new ZeroOrMoreMatcher(AnyMatcher.INSTANCE, m));
        }
        return OrMatcher.create(ms);
      }
    }
    return matcher;
  }
547605
def params_match?(params, match)
      return true if params == match
      parsed = parse_range_params(params)
      parsed == parsed.merge(parse_range_params(match))
    end
436530
@Factory
    public static <T extends Throwable> Matcher<T> hasCause(final Matcher<?> matcher) {
        return new ThrowableCauseMatcher<T>(matcher);
    }
1214992
public static boolean matches(final Pattern pattern, final String value, final boolean completeMatch) {
        val matcher = pattern.matcher(value);
        LOGGER.debug("Matching value [{}] against pattern [{}]", value, pattern.pattern());
        if (completeMatch) {
            return matcher.matches();
        }
        return matcher.find();
    }
552127
public <U extends T> OngoingMatchingC1<T, U, U> when(MatchesAny<U> o) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.any());
    return new OngoingMatchingC1<>(
        this,
        new DecomposableMatchBuilder1<U, U>(matchers, 0, new IdentityFieldExtractor<>()).build());
  }