FileInputStream inStream2 = new FileInputStream(inputDir + SEP + "keystore2.jks");
KeyStore ks2 = KeyStore.getInstance("JCEKS");
ks2.load(inStream2, "xmlsecurity".toCharArray());
StorageResolver storage = new StorageResolver(ks);
storage.add(ks2);
Iterator<?> iter = storage.getIterator();
checkIterator(iter);
// check new iterator starts from the beginning
Iterator<?> iter2 = storage.getIterator();
checkIterator(iter2);
// check the iterators are independent
// check calling next() without calling hasNext()
iter = storage.getIterator();
iter2 = storage.getIterator();
while (iter.hasNext()) {
X509Certificate cert = (X509Certificate) iter.next();
X509Certificate cert2 = (X509Certificate) iter2.next();
if (!cert.equals(cert2)) {