use of org.h2.dev.hash.IntPerfectHash in project h2database by h2database.
the class TestIntPerfectHash method test.
private int test(byte[] desc, Set<Integer> set) {
int max = -1;
HashSet<Integer> test = new HashSet<>();
IntPerfectHash hash = new IntPerfectHash(desc);
for (int x : set) {
int h = hash.get(x);
assertTrue(h >= 0);
assertTrue(h <= set.size() * 3);
max = Math.max(max, h);
assertFalse(test.contains(h));
test.add(h);
}
return max;
}
Aggregations