protected static String typeParamsToString(AptEnv env, Symbol sym) {
        if (sym.type.getTypeArguments().isEmpty()) {
            return "";
        }
        StringBuilder s = new StringBuilder();
        for (Type t : sym.type.getTypeArguments()) {
            Type.TypeVar tv = (Type.TypeVar) t;
            s.append(s.length() == 0 ? "<" : ", ")
             .append(TypeParameterDeclarationImpl.toString(env, tv));
        }
        s.append(">");
        return s.toString();
    }