BloomFilter implements Serializable { public void add(T key) { filter.put(key); } BloomFilter(Function<T, byte[]> serializer, int expectedInsertions, double falsePositiveRate); boolean mightContain(T key); void add(T key); void merge(BloomFilter<T> filter2); @Override boolean equals(Object o); @Override int hashCode();  }
@Test @SuppressWarnings("unchecked") public void testAdd() { BloomFilter result = (BloomFilter)run("BLOOM_ADD(BLOOM_INIT(), string, double, integer, map)", variables); for(Object val : variables.values()) { assertTrue(result.mightContain(val)); } assertTrue(result.mightContain(ImmutableMap.of("key1", "value1", "key2", "value2"))); }