@Test
public void testToJson() throws Exception {

    final Duration validPeriodAfterAccess = Duration.ofSeconds(10);
    final ExpirableBloomFilterConfig config = new ExpirableBloomFilterConfig(defaultTestingConfig);
    config.setValidPeriodAfterAccess(validPeriodAfterAccess);
    final GuavaBloomFilter expectedFilter = testingFactory.createFilter(config);
    final ObjectMapper mapper = new ObjectMapper();
    final String json = mapper.valueToTree(expectedFilter).toString();
    final GuavaBloomFilter filter = new ObjectMapper().readerFor(GuavaBloomFilter.class).readValue(json);
    assertThat(filter).isEqualTo(expectedFilter);
}