BloomFilter extends AbstractFilter { @Override public void add(Key key) { if(key == null) { throw new NullPointerException("key cannot be null"); } int[] h = hash.hash(key); hash.clear(); for(int i = 0; i < nbHash; i++) { bits.set(h[i]); } } BloomFilter();  BloomFilter(int vectorSize, int nbHash, int hashType); @Override void add(Key key); @Override void and(AbstractFilter filter); @Override boolean membershipTest(Key key); @Override void not(); @Override void or(AbstractFilter filter); @Override void xor(AbstractFilter filter); @Override String toString(); int getVectorSize(); @Override void write(DataOutput out); @Override void readFields(DataInput in);  }
@Test public void testAdd() { System.out.println("add"); for (int i = 0; i < 100; i++) { String val = UUID.randomUUID().toString(); Key k = new Key(val.getBytes()); bf.add(k); assertTrue(bf.membershipTest(k)); } }