Returns true if the specified method accepts a
<code>Substitution</code> as its last parameter.
974992
public boolean acceptsSubstitution(Method m) {
        Class<?>[] paramTypes = m.getParameterTypes();
        if (paramTypes.length > 0) {
            // Check if last param is a Substitution
            Class<?> lastParam = paramTypes[paramTypes.length - 1];
            return Substitution.class.isAssignableFrom(lastParam);
        }
        return false;
    }
811468
public static boolean chooseMathMethod(Selector info, MetaMethod metaMethod) {
        Map<MethodType,MethodHandle> xmap = methods.get(info.name);
        if (xmap==null) return false;

        MethodType type = replaceWithMoreSpecificType(info.args, info.targetType); 
        type = widenOperators(type); 
        
        MethodHandle handle = xmap.get(type);
        if (handle==null) return false;
        
        info.handle = handle;
        return true;
    }
126518
static boolean isGetterMethod(final Method method) {
        return (method.getName().startsWith(GETTER_GET_METHOD_PREFIX)
                || method.getName().startsWith(GETTER_IS_METHOD_PREFIX))
                &&
                !Void.TYPE.isAssignableFrom(method.getReturnType())
                &&
                !method.isVarArgs()
                &&
                method.getParameterTypes().length == 0;
    }
1373661
public static boolean isToStringMethod(Method method) {
        return (method != null && method.getName().equals("readString") && method.getParameterTypes().length == 0);
    }
489981
public static boolean isSetter(Method method) {
        String name = method.getName();
        String[] splitname = StringUtils.splitByCharacterTypeCamelCase(name);
        return method.getReturnType().equals(void.class) && Modifier.isPublic(method.getModifiers())
                && splitname[0].equals(SETTER_PREFIX);
    }
202762
def IsSatisfied(self):
    """"""
    # NOTE(psycho): We can't use the simple set difference here because we want
    # to match different parameters which are considered the same e.g. IsA(str)
    # and some string. This solution is O(n^2) but n should be small.
    tmp = self._methods.copy()
    for called in self._methods_called:
      for expected in tmp:
        if called == expected:
          tmp.remove(expected)
          if not tmp:
            return True
          break
    return False
803125
public static boolean shouldStub(CtMethod method, Collection<Class<?>> classesToStub) {
    // Stub any methods for which we have given explicit implementations
    if (STUB_METHODS.containsKey(new ClassAndMethod(
        method.getDeclaringClass().getName(), method.getName()))) {
      return true;
    }

    // Stub all non-abstract methods of classes for which stubbing has been requested
    for (Class<?> clazz : classesToStub) {
      if (declaringClassIs(method, clazz) && (method.getModifiers() & Modifier.ABSTRACT) == 0) {
        return true;
      }
    }

    // Stub all native methods
    if ((method.getModifiers() & Modifier.NATIVE) != 0) {
      return true;
    }

    return false;
  }
69851
private boolean isOperationMethod(Method method) {
    Class<?>[] paramTypes = method.getParameterTypes();
    return paramTypes.length == 1 && paramTypes[0] == Commit.class;
  }
214137
private boolean isLongAccess(MethodLiteral<?, ?> method) {
    boolean result = method.getReturnType().getRawType().equals(Long.TYPE);
    for (TypeLiteral<?> paramLiteral : method.getParameterTypes()) {
      result |= paramLiteral.getRawType().equals(Long.TYPE);
    }

    return result;
  }
1226713
private static boolean containsMethod(Method method, List<Method> methods) {
    if(methods != null) {
      for(Method aMethod : methods){
        if(method.getName().equals(aMethod.getName())) {
          return true;
        }
      }
    }
    return false;
  }
719777
protected boolean isSetterMethod(Method method) {
        Matcher matcher = _setterRegex.matcher(method.getName());
        if (matcher.matches()) {

            if (Modifier.isStatic(method.getModifiers())) return false;
            if (!Modifier.isPublic(method.getModifiers())) return false;
            if (!Void.TYPE.equals(method.getReturnType())) return false;

            // method parameter checks
            Class[] params = method.getParameterTypes();
            if (params.length != 1) return false;
            if (TypeMappingsFactory.TYPE_UNKNOWN == _tmf.getTypeId(params[0])) return false;

            return true;
        }
        return false;
    }
222270
public boolean hasParameter(String parameter) {
    if (info == null || info.parameters == null) {
      return false;
    }
    return info.parameters.containsKey(parameter);
  }
730324
private static boolean areMethodNameAndParameterTypesEqual(Method methodA, Method methodB) {
        if (!methodA.getName().equals(methodB.getName())) {
            return false;
        }
        Class<?>[] methodAParameterTypes = methodA.getParameterTypes();
        Class<?>[] methodBParameterTypes = methodB.getParameterTypes();
        if (methodAParameterTypes.length != methodBParameterTypes.length) {
            return false;
        }
        for (int i = 0; i < methodAParameterTypes.length; i++) {
            if (!methodAParameterTypes[i].equals(methodBParameterTypes[i])) {
                return false;
            }
        }

        return true;
    }
531946
public boolean accepts(Method method) {
        return isPublic(method) && isVoid(method) && takesOneParameter(method) && isAnnotatedAsSubscription(method);
    }
680078
private static boolean isRepoWS(String parameter)
   {
      String repWS = parameter;
      repWS = repWS.replaceAll("\\\\", "/");

      if ( !repWS.matches("[/][^/]+") && !repWS.matches("[/][^/]+[/][^/]+"))
      {
         return false;
      }
      else
      {
         return true;
      }
   }
954364
private static boolean isApplicable(Method method, Property property, boolean strict, boolean acceptPrefixless) {
        if (!method.getReturnType().isAssignableFrom(property.getTypeRef())) {
            return false;
        }

        String capitalized = capitalizeFirst(property.getName());
        if (method.getName().endsWith(GET_PREFIX + capitalized)) {
            return true;
        }

        if (method.getName().endsWith(IS_PREFIX + capitalized)) {
            return true;
        }

        if (method.getName().endsWith(SHOULD_PREFIX + capitalized)) {
            return true;
        }

        if (acceptPrefixless && method.getName().endsWith(property.getName())) {
            return true;
        }

        if (!strict) {
            if (method.getName().endsWith(GET_PREFIX + property.getNameCapitalized())) {
                return true;
            }

            if (method.getName().endsWith(IS_PREFIX + property.getNameCapitalized())) {
                return true;
            }


            //Some frameworks/tools consider valid getters cases like: get$ref() (e.g. jsonschema2pojo).
            if (method.getName().endsWith(GET_PREFIX + property.getName()) && !Character.isAlphabetic(property.getName().charAt(0))) {
                return true;
            }

            if (method.getName().endsWith(IS_PREFIX + property.getName()) && !Character.isAlphabetic(property.getName().charAt(0))) {
                return true;
            }

            if (method.getName().endsWith(SHOULD_PREFIX + property.getName()) && !Character.isAlphabetic(property.getName().charAt(0))) {
                return true;
            }

        }
        return false;
    }
945509
private static boolean hasPossibleMutatingMethods(@Nonnull final List<Method> methods) {
		boolean result = false;
		for (final Method method : methods) {
			if (!method.getAttributes().isEmpty()) {
				result = true;
				break;
			}
		}
		return result;
	}