class ReflectionUtils {

    public static List<Method> findMethods(Class<?> clazz, String nameRegex,
            ParamCount numberOfParams) {
        // Create the Pattern and Matcher outside the loop to optimize
        // performance (and possibly memory usage).
        Pattern p = Pattern.compile(nameRegex);
        Matcher m = p.matcher("");

        List<Method> methods = new ArrayList<Method>();
        for (Method method : clazz.getMethods()) {
            if (numberOfParams.matches(method.getParameterTypes().length)
                    && m.reset(method.getName()).matches()) {
                methods.add(method);
            }
        }
        return methods;
    }

    private  ReflectionUtils();

}