public static @Nullable Pair<@NotNull PsiType,@NotNull Integer> getComponentForSpreadWithDot(@NotNull PsiType type) {
    PsiType componentType;
    if (InheritanceUtil.isInheritor(type, JAVA_UTIL_COLLECTION)) {
      componentType = com.intellij.psi.util.PsiUtil.substituteTypeParameter(type, JAVA_UTIL_COLLECTION, 0, false);
    } else if (type instanceof PsiArrayType) {
      componentType = ((PsiArrayType)type).getComponentType();
    }
    else {
      componentType = null;
    }
    if (componentType == null) {
      return null;
    }
    var nested = getComponentForSpreadWithDot(componentType);
    return nested == null ? Pair.create(componentType, 1) : Pair.create(nested.first, nested.second + 1);
  }
public static @Nullable Pair<@NotNull PsiType,@NotNull Integer> getComponentForSpreadWithDot(@NotNull PsiType type)