public class ConcurrentCachedGenerator<T>
A generic wrapper that makes an underlying item generator thread-safe by
caching generated items in a concurrently-accessible list. This is more
efficient than plainly synchronizing all accessors of the generator.
Creates a new instance which wraps the given item generator and uses a
cache of the specified size. A larger cache will make the concurrency
slightly faster at the expense of increased memory usage, but may lead to
the computation of unnecessary values at the tail.