test_class.declarator: testingFilterName = "TestingFilterName"
test_class.modifier: private static final
test_class.original_string: private static final String testingFilterName = "TestingFilterName";
test_class.type: String
test_class.var_name: testingFilterName
test_class.file: filter-service-core/src/test/java/cn/leancloud/filter/service/InvalidBloomFilterPurgatoryTest.java
test_class.identifier: InvalidBloomFilterPurgatoryTest
test_case.body: @Test
      public void testPurge() {
          final ExpirableBloomFilterConfig config = new ExpirableBloomFilterConfig();
          final ZonedDateTime creationTime = ZonedDateTime.now(ZoneOffset.UTC).minus(Duration.ofSeconds(10));
          final ZonedDateTime expirationTime = creationTime.plusSeconds(5);
          final GuavaBloomFilterFactory mockedFactory = Mockito.mock(GuavaBloomFilterFactory.class);
  
          Mockito.when(mockedFactory.createFilter(config))
                  .thenReturn(new GuavaBloomFilter(
                          Configuration.defaultExpectedInsertions(),
                          Configuration.defaultFalsePositiveProbability(),
                          creationTime,
                          expirationTime,
                          null));
  
          final BloomFilterManagerImpl<GuavaBloomFilter, ExpirableBloomFilterConfig> manager = new BloomFilterManagerImpl<>(mockedFactory);
          final GuavaBloomFilter filter = manager.createFilter(testingFilterName, config).getFilter();
          final InvalidBloomFilterPurgatory<GuavaBloomFilter> purgatory =
                  new InvalidBloomFilterPurgatory<>(manager);
  
          assertThat(filter.expired()).isTrue();
          assertThat(manager.getFilter(testingFilterName)).isSameAs(filter);
  
          purgatory.purge();
  
          assertThat(manager.getFilter(testingFilterName)).isNull();
      }
test_case.class_method_signature: InvalidBloomFilterPurgatoryTest.testPurge()
test_case.full_signature: @Test public void testPurge()
test_case.identifier: testPurge
test_case.invocations: minus now ofSeconds plusSeconds mock thenReturn when createFilter defaultExpectedInsertions defaultFalsePositiveProbability getFilter createFilter isTrue assertThat expired isSameAs assertThat getFilter purge isNull assertThat getFilter
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPurge()
focal_class.declarator: manager
focal_class.modifier: private
focal_class.original_string: private BloomFilterManager<F, ?> manager;
focal_class.type: BloomFilterManager<F, ?>
focal_class.var_name: manager
focal_class.file: filter-service-core/src/main/java/cn/leancloud/filter/service/InvalidBloomFilterPurgatory.java
focal_class.identifier: InvalidBloomFilterPurgatory
focal_class.interfaces: implements Purgatory
focal_class.class_method_signature: InvalidBloomFilterPurgatory.InvalidBloomFilterPurgatory(BloomFilterManager<F, ?> manager)
focal_class.full_signature: public  InvalidBloomFilterPurgatory(BloomFilterManager<F, ?> manager)
focal_class.identifier: InvalidBloomFilterPurgatory
focal_class.modifiers: public
focal_class.parameters: (BloomFilterManager<F, ?> manager)
focal_class.signature:  InvalidBloomFilterPurgatory(BloomFilterManager<F, ?> manager)
focal_class.class_method_signature: InvalidBloomFilterPurgatory.purge()
focal_class.full_signature: @Override public void purge()
focal_class.identifier: purge
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void purge()
focal_method.body: @Override
      public void purge() {
          for (FilterRecord<F> holder : manager) {
              final F filter = holder.filter();
              if (!filter.valid()) {
                  final String name = holder.name();
                  manager.remove(name, filter);
              }
          }
      }
focal_method.class_method_signature: InvalidBloomFilterPurgatory.purge()
focal_method.full_signature: @Override public void purge()
focal_method.identifier: purge
focal_method.invocations: filter valid name remove
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void purge()