doFiltering(3, indexTerms, queryTerms);
}
public void testFnvBloomFilter() {
int indexFilter, queryFilter;
BloomFilter<Integer> filter = new FnvBloomFilter(2);
Element element = createElement(1, new String[] {"professional", "social", "network"});
indexFilter = filter.computeIndexFilter(element);
queryFilter = filter.computeQueryFilter(new String[]{"professional", "social", "network"});
assertEquals(queryFilter, (queryFilter & indexFilter));
queryFilter = filter.computeQueryFilter(new String[]{"social", "network"});
assertEquals(queryFilter, (queryFilter & indexFilter));
queryFilter = filter.computeQueryFilter(new String[]{"professional", "network"});
assertEquals(queryFilter, (queryFilter & indexFilter));
queryFilter = filter.computeQueryFilter(new String[]{"professional", "social"});
assertEquals(queryFilter, (queryFilter & indexFilter));
queryFilter = filter.computeQueryFilter(new String[]{"pro", "net"});
assertEquals(queryFilter, (queryFilter & indexFilter));
queryFilter = filter.computeQueryFilter(new String[]{"p", "n"});
assertEquals(queryFilter, (queryFilter & indexFilter));
}