package B6;

import com.google.android.gms.internal.measurement.AbstractC0707u1;
import com.google.android.gms.internal.measurement.C1;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.NoSuchElementException;

/* JADX INFO: loaded from: classes.dex */
public abstract class j extends AbstractC0707u1 {
    public static List D(Object[] objArr) {
        P6.g.e(objArr, "<this>");
        List listAsList = Arrays.asList(objArr);
        P6.g.d(listAsList, "asList(...)");
        return listAsList;
    }

    public static boolean E(Object[] objArr, Object obj) {
        int i;
        P6.g.e(objArr, "<this>");
        if (obj == null) {
            int length = objArr.length;
            i = 0;
            while (i < length) {
                if (objArr[i] == null) {
                    break;
                }
                i++;
            }
            i = -1;
        } else {
            int length2 = objArr.length;
            for (int i5 = 0; i5 < length2; i5++) {
                if (obj.equals(objArr[i5])) {
                    i = i5;
                    break;
                }
            }
            i = -1;
        }
        return i >= 0;
    }

    public static void F(int i, int i5, int i8, byte[] bArr, byte[] bArr2) {
        P6.g.e(bArr, "<this>");
        P6.g.e(bArr2, "destination");
        System.arraycopy(bArr, i5, bArr2, i, i8 - i5);
    }

    public static void G(int i, int i5, int i8, int[] iArr, int[] iArr2) {
        P6.g.e(iArr, "<this>");
        P6.g.e(iArr2, "destination");
        System.arraycopy(iArr, i5, iArr2, i, i8 - i5);
    }

    public static void H(int i, int i5, int i8, Object[] objArr, Object[] objArr2) {
        P6.g.e(objArr, "<this>");
        P6.g.e(objArr2, "destination");
        System.arraycopy(objArr, i5, objArr2, i, i8 - i5);
    }

    public static /* synthetic */ void I(int i, int i5, int i8, Object[] objArr, Object[] objArr2) {
        if ((i8 & 4) != 0) {
            i = 0;
        }
        H(0, i, i5, objArr, objArr2);
    }

    public static byte[] J(byte[] bArr, int i, int i5) {
        P6.g.e(bArr, "<this>");
        AbstractC0707u1.d(i5, bArr.length);
        byte[] bArrCopyOfRange = Arrays.copyOfRange(bArr, i, i5);
        P6.g.d(bArrCopyOfRange, "copyOfRange(...)");
        return bArrCopyOfRange;
    }

    public static Object[] K(Object[] objArr, int i, int i5) {
        P6.g.e(objArr, "<this>");
        AbstractC0707u1.d(i5, objArr.length);
        Object[] objArrCopyOfRange = Arrays.copyOfRange(objArr, i, i5);
        P6.g.d(objArrCopyOfRange, "copyOfRange(...)");
        return objArrCopyOfRange;
    }

    public static void L(Object[] objArr, int i, int i5) {
        P6.g.e(objArr, "<this>");
        Arrays.fill(objArr, i, i5, (Object) null);
    }

    public static ArrayList N(Object[] objArr) {
        ArrayList arrayList = new ArrayList();
        for (Object obj : objArr) {
            if (obj != null) {
                arrayList.add(obj);
            }
        }
        return arrayList;
    }

    public static char O(char[] cArr) {
        int length = cArr.length;
        if (length == 0) {
            throw new NoSuchElementException("Array is empty.");
        }
        if (length == 1) {
            return cArr[0];
        }
        throw new IllegalArgumentException("Array has more than one element.");
    }

    public static List P(Object[] objArr) {
        int length = objArr.length;
        return length != 0 ? length != 1 ? new ArrayList(new h(objArr, false)) : C1.C(objArr[0]) : t.f1032q;
    }
}
