protected Method getMethod() { Method method = null; if (countMethodsWithSameName() > 1) { method = reflectionProvider.getMethod(controller, methodName, getClasses(args)); if (method == null && args.isEmpty()) { throw new IllegalArgumentException("Ambiguous method '" + methodName + "' on " + controller + ". Try to add some parameters to resolve ambiguity, or use different method names."); } } else { method = findMethodWithName(controller, methodName); } if(method == null) { throw new IllegalArgumentException( String.format("There are no methods on %s named '%s' that receives args of types %s", controller, methodName, Arrays.toString(getClasses(args)))); } return method; }