class SlidingWindow {

    public T current() {
        long key = bucket(clock.millis());
        AtomicBoolean updated = new AtomicBoolean();
        T bucket = buckets.computeIfAbsent(key, k -> {
            updated.set(true);
            return createOperation.get();
        });
        if( updated.get()) {
            truncate(key- maxBuckets);
        }
        return bucket;
    }

    public  SlidingWindow(Supplier<T> createOperation, BinaryOperator<T> aggregateOperation, Clock clock);
    public  SlidingWindow(int bucketSize, int history, TimeUnit timeUnit, Supplier<T> createOperation, BinaryOperator<T> aggregateOperation, Clock clock);

}