private static List<Trinity<GrSignature, ArgInfo<PsiType>[], Applicability>> getSignatureApplicabilities(@NotNull List<? extends GrSignature> signatures,
                                                                                                           final PsiType @NotNull [] args,
                                                                                                           @NotNull final PsiElement context) {
    final List<Trinity<GrSignature, ArgInfo<PsiType>[], Applicability>> results = new ArrayList<>();
    for (GrSignature signature : signatures) {
      ArgInfo<PsiType>[] map = mapArgTypesToParameters(signature, args, context, false);
      if (map != null) {
        results.add(new Trinity<>(signature, map, isSignatureApplicableInner(map, signature)));
        continue;
      }

      // check for the case foo([1, 2, 3]) if foo(int, int, int)
      if (args.length == 1 && PsiUtil.isInMethodCallContext(context)) {
        final GrClosureParameter[] parameters = signature.getParameters();
        if (parameters.length == 1 && parameters[0].getType() instanceof PsiArrayType) {
          continue;
        }
        PsiType arg = args[0];
        if (arg instanceof GrTupleType) {
          PsiType[] _args = ((GrTupleType)arg).getComponentTypesArray();
          map = mapArgTypesToParameters(signature, _args, context, false);
          if (map != null) {
            results.add(new Trinity<>(signature, map,
                                      isSignatureApplicableInner(map,
                                                                 signature)));
          }
        }
      }
    }
    return results;
  }
private static List<Trinity<GrSignature, ArgInfo<PsiType>[], Applicability>> getSignatureApplicabilities(@NotNull List<? extends GrSignature> signatures,
                                                                                                           final PsiType @NotNull [] args,
                                                                                                           @NotNull final PsiElement context)