private InferenceStep buildReturnTypeClosureStep(@NotNull PsiType closure,
                                                   @Nullable PsiType returnType,
                                                   PsiTypeParameter[] typeParameters) {
    PsiType[] parameters = ((PsiClassType)closure).getParameters();
    if (parameters.length != 1) return InferenceStep.EMPTY;
    PsiType[] rightTypes = closure instanceof GrClosureType ? ((GrClosureType)closure).inferParameters() : parameters;

    return buildStep(new PsiType[]{returnType}, rightTypes, typeParameters);
  }
private InferenceStep buildReturnTypeClosureStep(@NotNull PsiType closure,
                                                   @Nullable PsiType returnType,
                                                   PsiTypeParameter[] typeParameters)