package o;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Ai, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC0008Ai extends AbstractC0662Zn {
    public static ArrayList P(Object... objArr) {
        return objArr.length == 0 ? new ArrayList() : new ArrayList(new C1076e9(objArr, true));
    }

    public static int Q(ArrayList arrayList, Comparable comparable) {
        int size = arrayList.size();
        int size2 = arrayList.size();
        int i = 0;
        if (size < 0) {
            throw new IllegalArgumentException("fromIndex (0) is greater than toIndex (" + size + ").");
        }
        if (size > size2) {
            throw new IndexOutOfBoundsException("toIndex (" + size + ") is greater than size (" + size2 + ").");
        }
        int i2 = size - 1;
        while (i <= i2) {
            int i3 = (i + i2) >>> 1;
            int iK = AbstractC2798wI.k((Comparable) arrayList.get(i3), comparable);
            if (iK < 0) {
                i = i3 + 1;
            } else {
                if (iK <= 0) {
                    return i3;
                }
                i2 = i3 - 1;
            }
        }
        return -(i + 1);
    }

    public static int R(List list) {
        return list.size() - 1;
    }

    public static List S(Object... objArr) {
        return objArr.length > 0 ? Arrays.asList(objArr) : C0332Mv.l;
    }

    public static ArrayList T(Object... objArr) {
        return objArr.length == 0 ? new ArrayList() : new ArrayList(new C1076e9(objArr, true));
    }

    public static final List U(List list) {
        int size = list.size();
        return size != 0 ? size != 1 ? list : Collections.singletonList(list.get(0)) : C0332Mv.l;
    }

    public static void V() {
        throw new ArithmeticException("Index overflow has happened.");
    }
}
