int numElems = 100000;
double pct = 0.01;
HashSet<String> unionMap = new HashSet<String>();
Filter bloom1 = BloomFactory.NewBloomInstance( numElems, pct);
for( int i = 0; i< numElems/2; ++i ) {
UUID uuid = UUID.randomUUID();
Key key = new Key(uuid.toString().getBytes() );
bloom1.add( key );
Assert.assertTrue( bloom1.membershipTest(key));
(unionMap).add( uuid.toString());
if( (i % 10000) == 0 ) {
System.out.println(" Added " + i + " elements.");
}
}
Filter bloom2 = BloomFactory.NewBloomInstance( numElems, pct);
for( int i = 0; i< numElems/2; ++i ) {
UUID uuid = UUID.randomUUID();
Key key = new Key(uuid.toString().getBytes() );
bloom2.add( key );
Assert.assertTrue( bloom2.membershipTest(key));
(unionMap).add( uuid.toString());
if( (i % 10000) == 0 ) {
System.out.println(" Added " + i + " elements.");
}