class SharedFileBackedOutputStream extends FileBackedOutputStream {

    @SuppressWarnings("unchecked")
    @Override
    public void cleanup() {
        Preconditions.checkState(usageCount.get() > 0);

        if (usageCount.decrementAndGet() == 0) {
            super.cleanup();

            if (onCleanupCallback != null) {
                onCleanupCallback.accept(onCleanupContext);
            }
        }
    }

    public  SharedFileBackedOutputStream(int fileThreshold, String fileDirectory);

}