@Test public void bulkContains() { int n = 1000; double p = 0.01; String name = "loadExistingTest"; String testString = "simpletest"; cleanupRedis(); BloomFilter<String> first = createFilter(name, n, p, true); first.add(testString); List<String> samples = new ArrayList<>(); samples.add("one"); samples.add("two"); samples.add("three"); samples.add("four"); first.addAll(samples); samples.add("five"); samples.add("six"); samples.add(testString); List<Boolean> exists = first.contains(samples); assertTrue(exists.get(0)); // "one" assertTrue(exists.get(1)); // "two" assertTrue(exists.get(2)); // "three" assertTrue(exists.get(3)); // "four" assertTrue(!exists.get(4)); // "five" assertTrue(!exists.get(5)); // "six" assertTrue(exists.get(6)); // "simpleTest" ArrayList<String> testPositive = new ArrayList<>(); testPositive.add("one"); testPositive.add("two"); testPositive.add("three"); testPositive.add("four"); ArrayList<String> testNegative = new ArrayList<>(); testNegative.add("five"); testNegative.add("six"); assertTrue(first.containsAll(testPositive)); assertFalse(first.containsAll(testNegative)); }