public static HashFunction concatenating ( HashFunction first , HashFunction second , HashFunction ... rest ) { // We can't use Lists.asList() here because there's no hash->collect dependency List < HashFunction > list = new ArrayList <> ( ) ; list . add ( first ) ; list . add ( second ) ; list . addAll ( Arrays . asList ( rest ) ) ; return new ConcatenatedHashFunction ( list . toArray ( new HashFunction [ 0 ] ) ) ; }
Returns a hash function which computes its hash code by concatenating the hash codes of the underlying hash functions together . This can be useful if you need to generate hash codes of a specific length .