@Test
public void testExpectedFalsePositiveProbability() {

    // These probabilities are taken from the bloom filter probability table at
    // http://pages.cs.wisc.edu/~cao/papers/summary-cache/node8.html
    System.out.println("expectedFalsePositiveProbability");
    BloomFilterAlt instance = new BloomFilterAlt(1000, 100);
    double expResult = 0.00819; // m/n=10, k=7
    double result = instance.expectedFalsePositiveProbability();
    assertEquals(instance.getK(), 7);
    assertEquals(expResult, result, 0.000009);
    instance = new BloomFilterAlt(100, 10);
    expResult = 0.00819; // m/n=10, k=7
    result = instance.expectedFalsePositiveProbability();
    assertEquals(instance.getK(), 7);
    assertEquals(expResult, result, 0.000009);
    instance = new BloomFilterAlt(20, 10);
    expResult = 0.393; // m/n=2, k=1
    result = instance.expectedFalsePositiveProbability();
    assertEquals(1, instance.getK());
    assertEquals(expResult, result, 0.0005);
    instance = new BloomFilterAlt(110, 10);
    expResult = 0.00509; // m/n=11, k=8
    result = instance.expectedFalsePositiveProbability();
    assertEquals(8, instance.getK());
    assertEquals(expResult, result, 0.00001);
}