public Iterator merge(Iterator[] selections) {
		HashSet result = null;

		for (int i = 0; i < selections.length; i++) {
			PersistentIterator iterator = (PersistentIterator) selections[i];
			HashSet newResult = new HashSet();
			int oid;

			while ((oid = iterator.nextOid()) != 0) {
				Integer oidWrapper = new Integer(oid);
				if (result == null || result.contains(oidWrapper)) {
					newResult.add(oidWrapper);
				}
			}

			result = newResult;

			if (result.size() == 0) {
				break;
			}
		}

		if (result == null) {
			result = new HashSet();
		}

		return new HashIterator(result);
	}