elk-util-parent/elk-util-hashing/src/main/java/org/semanticweb/elk/util/hashing/HashGenerator.java
public static <T> int combineMultisetHash(boolean finalize,
			Iterator<? extends T> hashObjectIterator, Hasher<T> hasher) {
		int hash = 0;
		while (hashObjectIterator.hasNext()) {
			hash += hasher.hash(hashObjectIterator.next());
		}
		if (finalize) {
			hash = combineListHash(hash);
		}
		return hash;
	}
public static <T> int combineMultisetHash(boolean finalize,
			Iterator<? extends T> hashObjectIterator, Hasher<T> hasher) {
		int hash = 0;
		while (hashObjectIterator.hasNext()) {
			hash += hasher.hash(hashObjectIterator.next());
		}
		if (finalize) {
			hash = combineListHash(hash);
		}
		return hash;
	}
Combine the hash codes of a collection of objects with an associative
commutative hash function. Associativity ensures that the result of this
functions can be further combined with other hash codes for getting the
same result as if all hash codes had been combined in one step.

If finalize is false, then the method as such represents an associative
commutative hash, i.e. the return value can be combined with other
set-based hash codes in any order without making a difference. If
finalize is true, then the method combines its arguments with a
commutative hash, but shuffles the overall result. The method as such
then is neither an associative nor a commutative operation. This mode of
operation should be used whenever no further elements are to be added to
the set of hashes.

@param <T>

@param finalize
@param hashObjectIterator
@param hasher
@return the combined hash code