public JavaMethod getMethodFromSignature(String signature) {

        if (signature == null || signature.equals("") || !signature.startsWith("(")) {
            return null;
        }

        final int closingIndex = signature.lastIndexOf(')');
        if (closingIndex <= 0 || closingIndex >= signature.length() - 1) {
            return null;
        }

        final String parametersSignature = signature.substring(1, closingIndex);
        final JavaType parameters;
        if (parametersSignature.length() != 0) {
            parameters = getFromSignature(parametersSignature);
            if (parameters == null) {
                return null;
            }
        } else {
            parameters = new JavaTypeList();
        }

        final JavaType returningType = getFromSignature(signature
                .substring(closingIndex + 1));
        if (returningType == null || returningType instanceof JavaTypeList) {
            return null;
        }

        return new JavaMethod(parameters, returningType);
    }