package com.google.android.gms.common.data; import java.util.ArrayList; import java.util.Iterator; import org.simpleframework.xml.core.FieldScanner; /* loaded from: classes.dex */ public final class FreezableUtils { public static > ArrayList freeze(ArrayList arrayList) { FieldScanner fieldScanner = (ArrayList) new ArrayList(arrayList.size()); int size = arrayList.size(); for (int i = 0; i < size; i++) { fieldScanner.add(arrayList.get(i).freeze()); } return fieldScanner; } public static > ArrayList freezeIterable(Iterable iterable) { FieldScanner fieldScanner = (ArrayList) new ArrayList(); Iterator it = iterable.iterator(); while (it.hasNext()) { fieldScanner.add(it.next().freeze()); } return fieldScanner; } public static > ArrayList freeze(E[] eArr) { FieldScanner fieldScanner = (ArrayList) new ArrayList(eArr.length); for (E e : eArr) { fieldScanner.add(e.freeze()); } return fieldScanner; } }