docs: static Method findMethod(Class<?> clazz, String methodName, Object[] args, boolean isStatic) throws NoSuchMethodException
  	{
  		Class<?>[] argTypes = getTypes(args);
  
  		Method[] methods = null;
  		if (classMethodsCache.containsKey(clazz))
  		{
  			methods = classMethodsCache.get(clazz);
  		}
  		else
  		{
  			methods = clazz.getMethods();
  			classMethodsCache.put(clazz, methods);
  		}
  
  		ArrayList<Method> fitMethods = new ArrayList<Method>();
  		for (Method method : methods)
  		{
  			if (methodName.equals(method.getName()))
  			{
  				if (!isStatic || Modifier.isStatic(method.getModifiers()))
  				{
  					if (match(argTypes, method.getParameterTypes()))
  					{
  						fitMethods.add(method);
  					}
  				}
  			}
  		}
  		int fitSize = fitMethods.size();
  		if (fitSize == 0)
  		{
  			throw new NoSuchMethodException(Messages.getString("beans.41", methodName)); //$NON-NLS-1$
  		}
  		if (fitSize == 1)
  		{
  			return fitMethods.get(0);
  		}
  		// find the most relevant one
  		MethodComparator comparator = new MethodComparator(methodName, argTypes);
  		Method[] fitMethodArray = fitMethods.toArray(new Method[fitSize]);
  		Method onlyMethod = fitMethodArray[0];
  		Class<?> onlyReturnType, fitReturnType;
  		int difference;
  		for (int i = 1; i < fitMethodArray.length; i++)
  		{
  			// if 2 methods have same relevance, check their return type
  			if ((difference = comparator.compare(onlyMethod, fitMethodArray[i])) == 0)
  			{
  				// if 2 methods have the same signature, check their return type
  				onlyReturnType = onlyMethod.getReturnType();
  				fitReturnType = fitMethodArray[i].getReturnType();
  				if (onlyReturnType == fitReturnType)
  				{
  					// if 2 methods have the same relevance and return type
  					throw new NoSuchMethodException(Messages.getString("beans.62", methodName)); //$NON-NLS-1$
  				}
  
  				if (onlyReturnType.isAssignableFrom(fitReturnType))
  				{
  					// if onlyReturnType is super class or interface of
  					// fitReturnType, set onlyMethod to fitMethodArray[i]
  					onlyMethod = fitMethodArray[i];
  				}
  			}
  			if (difference > 0)
  			{
  				onlyMethod = fitMethodArray[i];
  			}
  		}
  		return onlyMethod;
  	}