void () { class AwfulHashCode { @Override public int hashCode() { return 0; } } ConcurrentMap<Object, Object> map = ConcurrentCollectionFactory.createConcurrentMap(new HashingStrategy<>() { @Override public int hashCode(Object object) { return 0; } @Override public boolean equals(Object o1, Object o2) { return o1 == o2; } }); int N = 1000; for (int i = 0; i < N; i++) { map.put(new AwfulHashCode(), 0); } assertEquals(N, map.size()); }