private synchronized void closeOldAggregates() {
        final AtomicInteger count = new AtomicInteger();
        final Set<FeedKey> feedKeys = aggregateStateMap.keySet();
        for (final FeedKey feedKey : feedKeys) {
            // It's possible another thread may have removed it
            final AggregateState aggregateState = aggregateStateMap.get(feedKey);
            if (aggregateState != null
                && aggregateState.isAggregateTooOld()) {
                // Close the current aggregate, under a feedKey lock, so again,
                // another thread may beat us
                final boolean didClose = closeAggregate(feedKey, aggregateState);
                if (didClose) {
                    count.incrementAndGet();
                } else {
                    LOGGER.debug("closeAggregate() - feedKey: {}, aggregateState: {}, didn't close",
                            feedKey, aggregateState);
                }
            }
        }
        if (LOGGER.isDebugEnabled()) {
            if (count.get() > 0) {
                LOGGER.debug("closeOldAggregates() - closed {} old aggregates", count);
            }
        }
    }
Synchronised to stop closeOldAggregates being called concurrently (which
shouldn't really happen with the frequency executor), but
closeAggregate() will still happen under the striped lock to protect it
from other threads working on aggregates
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/PreAggregator.java