@Nullable
  public static PsiType getReturnType(@NotNull final List<? extends GrSignature> signatures, PsiType @Nullable [] args, @NotNull PsiElement context) {
    if (signatures.size() == 1) {
      return signatures.get(0).getReturnType();
    }

    final PsiManager manager = context.getManager();

    if (args == null) {
      return TypesUtil.getLeastUpperBoundNullable(ContainerUtil.map(signatures, GrSignature::getReturnType), manager);
    }

    final List<Trinity<GrSignature, ArgInfo<PsiType>[], Applicability>> results =
      getSignatureApplicabilities(signatures, args, context);

    if (results.size() == 1) return results.get(0).first.getReturnType();

    return TypesUtil.getLeastUpperBoundNullable(ContainerUtil.map(results, it -> it.first.getReturnType()), manager);
  }
@Nullable
  public static PsiType getReturnType(@NotNull final List<? extends GrSignature> signatures, PsiType @Nullable [] args, @NotNull PsiElement context)