private static PsiArrayType getSuspiciousVarargType(PsiCall call, PsiType type, Supplier<? extends PsiMethod> resolver) {
      final boolean checkArray;
      if (PsiTypes.nullType().equals(type)) {
        checkArray = false;
      }
      else if (type instanceof PsiArrayType) {
        checkArray = true;
      }
      else {
        return null;
      }
      final PsiMethod method = resolver.get();
      if (method == null) {
        return null;
      }
      final PsiParameterList parameterList = method.getParameterList();
      PsiExpressionList argumentList = call.getArgumentList();
      if (argumentList == null || parameterList.getParametersCount() != argumentList.getExpressionCount()) {
        return null;
      }
      final PsiParameter[] parameters = parameterList.getParameters();
      final PsiParameter lastParameter = parameters[parameters.length - 1];
      if (!lastParameter.isVarArgs()) {
        return null;
      }
      final PsiType type1 = lastParameter.getType();
      if (!(type1 instanceof PsiEllipsisType ellipsisType)) {
        return null;
      }

        final PsiArrayType arrayType = (PsiArrayType)ellipsisType.toArrayType();
      final PsiType componentType = arrayType.getComponentType();
      if (checkArray) {
        if (!componentType.equals(TypeUtils.getObjectType(call))) {
          return null;
        }
        if (type.isAssignableFrom(arrayType) || !arrayType.isAssignableFrom(type)) {
          return null;
        }
      }
      return arrayType;
    }
private static PsiArrayType getSuspiciousVarargType(PsiCall call, PsiType type, Supplier<? extends PsiMethod> resolver)