package kotlin.collections; import java.util.ArrayList; import java.util.Collection; import java.util.List; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes5.dex */ public abstract class CollectionsKt__CollectionsKt extends CollectionsKt__CollectionsJVMKt { public static final Collection asCollection(Object[] objArr) { Intrinsics.checkNotNullParameter(objArr, ""); return new ArrayAsCollection(objArr, false); } public static List emptyList() { return EmptyList.INSTANCE; } public static List listOf(Object... elements) { List asList; Intrinsics.checkNotNullParameter(elements, "elements"); if (elements.length <= 0) { return emptyList(); } asList = ArraysKt___ArraysJvmKt.asList(elements); return asList; } public static List mutableListOf(Object... elements) { Intrinsics.checkNotNullParameter(elements, "elements"); return elements.length == 0 ? new ArrayList() : new ArrayList(new ArrayAsCollection(elements, true)); } public static ArrayList arrayListOf(Object... elements) { Intrinsics.checkNotNullParameter(elements, "elements"); return elements.length == 0 ? new ArrayList() : new ArrayList(new ArrayAsCollection(elements, true)); } public static List listOfNotNull(Object... elements) { List filterNotNull; Intrinsics.checkNotNullParameter(elements, "elements"); filterNotNull = ArraysKt___ArraysKt.filterNotNull(elements); return filterNotNull; } public static int getLastIndex(List list) { Intrinsics.checkNotNullParameter(list, ""); return list.size() - 1; } public static final List optimizeReadOnlyList(List list) { Intrinsics.checkNotNullParameter(list, ""); int size = list.size(); if (size != 0) { return size != 1 ? list : CollectionsKt__CollectionsJVMKt.listOf(list.get(0)); } return emptyList(); } public static void throwIndexOverflow() { throw new ArithmeticException("Index overflow has happened."); } public static void throwCountOverflow() { throw new ArithmeticException("Count overflow has happened."); } }