code: public static <R extends Random, T> T with(
  		final ThreadLocal<R> random,
  		final Function<? super R, ? extends T> function
  	) {
  		return CONTEXT.with(random::get, s -> function.apply(random.get()));
  	}
docs: Opens a new {@code Scope} with the given random engine and executes the
  given function within it. The following example shows how to create a
  reproducible list of genotypes:
  <pre>{@code
  final List<Genotype<DoubleGene>> genotypes =
  with(new LCG64ShiftRandom.ThreadLocal(), random ->
  Genotype.of(DoubleChromosome.of(0, 10)).instances()
  .limit(50)
  .collect(toList())
  );
  }</pre>
  
  @since 3.0
  
  @param <R> the type of the random engine
  @param <T> the function return type
  @param random the PRNG used for the opened scope
  @param function the function to apply within the random scope
  @return the object returned by the given function
  @throws NullPointerException if one of the arguments is {@code null}.