package p009c1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.NoSuchElementException;
import p039m1.C1470g;

/* renamed from: c1.d */
/* loaded from: classes.dex */
public class C0499d extends C0498c {
    /* renamed from: d */
    public static final <T> List<T> m3615d(T[] tArr) {
        C1470g.m1292e(tArr, "<this>");
        return (List) m3614e(tArr, new ArrayList());
    }

    /* renamed from: e */
    public static final <C extends Collection<? super T>, T> C m3614e(T[] tArr, C c) {
        C1470g.m1292e(tArr, "<this>");
        C1470g.m1292e(c, "destination");
        for (T t : tArr) {
            if (t != null) {
                c.add(t);
            }
        }
        return c;
    }

    /* renamed from: f */
    public static final char m3613f(char[] cArr) {
        C1470g.m1292e(cArr, "<this>");
        int length = cArr.length;
        if (length != 0) {
            if (length == 1) {
                return cArr[0];
            }
            throw new IllegalArgumentException("Array has more than one element.");
        }
        throw new NoSuchElementException("Array is empty.");
    }

    /* renamed from: g */
    public static final <T> T m3612g(T[] tArr) {
        C1470g.m1292e(tArr, "<this>");
        if (tArr.length == 1) {
            return tArr[0];
        }
        return null;
    }
}