class BloomFilterManagerImpl implements BloomFilterManager<T, C>,
        Listenable<BloomFilterManagerListener<? super T, C>> {

    @Override
    public CreateFilterResult<T> createFilter(String name, C config, boolean overwrite) {
        T filter;
        T prevFilter;
        boolean created = false;
        filterMapLock.lock();
        try {
            prevFilter = filterMap.get(name);
            if (overwrite || prevFilter == null || !prevFilter.valid()) {
                filter = factory.createFilter(config);
                filterMap.put(name, filter);
                created = true;
            } else {
                filter = prevFilter;
            }
        } finally {
            filterMapLock.unlock();
        }

        if (created) {
            if (prevFilter != null) {
                notifyBloomFilterRemoved(name, prevFilter);
            }

            notifyBloomFilterCreated(name, config, filter);
        }

        return new CreateFilterResult<>(filter, created);
    }

      BloomFilterManagerImpl(BloomFilterFactory<? extends T, ? super C> factory);

}