AbstractBloomFilterConfig implements BloomFilterConfig<T>, Cloneable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final AbstractBloomFilterConfig<?> that = (AbstractBloomFilterConfig<?>) o; return expectedInsertions() == that.expectedInsertions() && Double.compare(that.fpp(), fpp()) == 0; } AbstractBloomFilterConfig();   AbstractBloomFilterConfig(int expectedInsertions, double fpp); int expectedInsertions(); double fpp(); @SuppressWarnings("unchecked") @Override T setExpectedInsertions(int expectedInsertions); @SuppressWarnings("unchecked") @Override T setFpp(double fpp); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { final double fpp = ThreadLocalRandom.current().nextDouble(0.0001, 1); final int expectedInsertions = ThreadLocalRandom.current().nextInt(1, Integer.MAX_VALUE); final TestingBloomFilterConfig filterA = new TestingBloomFilterConfig() .setFpp(fpp) .setExpectedInsertions(expectedInsertions); final TestingBloomFilterConfig filterB = new TestingBloomFilterConfig() .setFpp(fpp) .setExpectedInsertions(expectedInsertions); assertThat(filterA).isEqualTo(filterB); }