private void assertAllIn(Set<String> strings, BytesRefHash hash) {
BytesRefBuilder ref = new BytesRefBuilder();
BytesRef scratch = new BytesRef();
long count = hash.size();
for (String string : strings) {
ref.copyChars(string);
long key = hash.add(ref.get()); // add again to check duplicates
assertEquals(string, hash.get((-key)-1, scratch).utf8ToString());
assertEquals(count, hash.size());
assertTrue("key: " + key + " count: " + count + " string: " + string,
key < count);