package org.bouncycastle.util; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; /* loaded from: classes6.dex */ public class CollectionStore implements Store, Iterable { private Collection _local; @Override // org.bouncycastle.util.Iterable, java.lang.Iterable public Iterator iterator() { return getMatches(null).iterator(); } @Override // org.bouncycastle.util.Store public Collection getMatches(Selector selector) { if (selector == null) { return new ArrayList(this._local); } ArrayList arrayList = new ArrayList(); for (T t : this._local) { if (selector.match(t)) { arrayList.add(t); } } return arrayList; } public CollectionStore(Collection collection) { this._local = new ArrayList(collection); } }