class SearchUtils {

    public static List<MethodNode> findMethodsWithParameters(Collection<MethodNode> methodNodes, Type ... paramTypes) {
        Validate.notNull(methodNodes);
        Validate.notNull(paramTypes);
        Validate.noNullElements(methodNodes);
        Validate.noNullElements(paramTypes);
        for (Type paramType : paramTypes) {
            Validate.isTrue(paramType.getSort() != Type.METHOD && paramType.getSort() != Type.VOID);
        }

        List<MethodNode> ret = new ArrayList<>();
        for (MethodNode methodNode : methodNodes) {
            Type methodDescType = Type.getType(methodNode.desc);
            Type[] methodParamTypes = methodDescType.getArgumentTypes();

            if (methodParamTypes.length != paramTypes.length) {
                continue;
            }

            boolean found = true;
            for (int i = 0; i < methodParamTypes.length; i++) {
                if (!paramTypes[i].equals(methodParamTypes[i])) {
                    found = false;
                }
            }

            if (found) {
                ret.add(methodNode);
            }
        }

        return ret;
    }

    private  SearchUtils();

}