package com.huawei.hms.common.data; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import org.simpleframework.xml.core.FieldScanner; /* loaded from: classes2.dex */ public final class FreezableUtils { public static > ArrayList freeze(ArrayList arrayList) { return freezeIterable(arrayList); } public static > ArrayList freezeIterable(Iterable iterable) { FieldScanner fieldScanner = (ArrayList) new ArrayList(); if (iterable == null) { return fieldScanner; } Iterator it = iterable.iterator(); while (it.hasNext()) { fieldScanner.add(it.next().freeze()); } return fieldScanner; } public static > ArrayList freeze(E[] eArr) { return freezeIterable(Arrays.asList(eArr)); } }