BloomFilter implements Serializable { public double expectedFalsePositiveProbability() { return getFalsePositiveProbability(expectedNumberOfFilterElements); } BloomFilter(double c, int n, int k);  BloomFilter(int bitSetSize, int expectedNumberOElements);  BloomFilter(double falsePositiveProbability, int expectedNumberOfElements);  BloomFilter(int bitSetSize, int expectedNumberOfFilterElements, int actualNumberOfFilterElements, BitSet filterData); @Override boolean equals(Object obj); @Override int hashCode(); double expectedFalsePositiveProbability(); double getFalsePositiveProbability(double numberOfElements); double getFalsePositiveProbability(); int getK(); synchronized void clear(); synchronized void add(byte[] bytes); synchronized boolean contains(byte[] bytes); synchronized boolean getBit(int bit); synchronized void setBit(int bit, boolean value); synchronized BitSet getBitSet(); synchronized int size(); synchronized int count(); int getExpectedNumberOfElements(); double getExpectedBitsPerElement(); double getBitsPerElement();  }
@Test public void testExpectedFalsePositiveProbability() { System.out.println("expectedFalsePositiveProbability"); BloomFilter instance = new BloomFilter(1000, 100); double expResult = 0.00819; double result = instance.expectedFalsePositiveProbability(); assertEquals(instance.getK(), 7); assertEquals(expResult, result, 0.000009); instance = new BloomFilter(100, 10); expResult = 0.00819; result = instance.expectedFalsePositiveProbability(); assertEquals(instance.getK(), 7); assertEquals(expResult, result, 0.000009); instance = new BloomFilter(20, 10); expResult = 0.393; result = instance.expectedFalsePositiveProbability(); assertEquals(1, instance.getK()); assertEquals(expResult, result, 0.0005); instance = new BloomFilter(110, 10); expResult = 0.00509; result = instance.expectedFalsePositiveProbability(); assertEquals(8, instance.getK()); assertEquals(expResult, result, 0.00001); }