void (@NotNull GrMethod method) { final PsiTypeParameter[] parameters = method.getTypeParameters(); final Map<PsiTypeParameter, PsiType> map = new HashMap<>(); for (PsiTypeParameter parameter : parameters) { final PsiClassType[] types = parameter.getSuperTypes(); final PsiType bound = PsiIntersectionType.createIntersection(types); final PsiWildcardType wildcardType = PsiWildcardType.createExtends(method.getManager(), bound); map.put(parameter, wildcardType); } final PsiSubstitutor substitutor = PsiSubstitutor.createSubstitutor(map); for (GrParameter parameter : method.getParameterList().getParameters()) { final GrExpression initializer = parameter.getInitializerGroovy(); if (initializer == null) continue; final PsiType targetType = parameter.getType(); processAssignment( substitutor.substitute(targetType), initializer, parameter.getNameIdentifierGroovy(), parameter ); } }