public List<String> generateHashClashes(final int desiredRecords,
                                            final ValueStoreHashAlgorithm valueStoreHashAlgorithm) {

        List<String> strings = new ArrayList<>(Arrays.asList("Aa", "BB"));
        List<String> temp = new ArrayList<>();

        complete:
        for (int i = 0; i < 5; i++) {
            int size = strings.size();
            temp = new ArrayList<>(size * size);
            int count = 0;
            for (String s : strings) {
                for (String t : strings) {
                    if (count == desiredRecords) {
                        break complete;
                    }
                    temp.add(s + t);
                    count++;
                }
            }
            strings = temp;
        }
        strings = temp;

        //dbl check all have same hash
        assertThat(strings.stream()
                .peek(str -> {
                    LOGGER.info("{} {} {}", str, str.hashCode(), valueStoreHashAlgorithm.hash(str));
                })
                .map(valueStoreHashAlgorithm::hash)
                .distinct()
                .count()).isEqualTo(1);

        return strings;
    }
Generate a list (of size desiredRecords) of strings that all share the same hashcode
Adapted from https://gist.github.com/vaskoz/5703423
stroom-pipeline/src/test/java/stroom/pipeline/refdata/store/offheapstore/databases/TestValueStoreDb.java