random
Access to the current {@link RandomizedContext}'s Random instance. It is safe to use this method from multiple threads, etc., but it should be called while within a runner's scope (so no static initializers). The returned {@link Random} instance will be different when this method is called inside a {@link BeforeClass} hook (static suite scope) and within {@link Before}/ {@link After} hooks or test methods.
The returned instance must not be shared with other threads or cross a single scope's boundary. For example, a {@link Random} acquired within a test method shouldn't be reused for another test case.
There is an overhead connected with getting the {@link Random} for a particular context and thread. It is better to cache the {@link Random} locally if tight loops with multiple invocations are present or create a derivative local {@link Random} for millions of calls like this:
Random random = new Random(random().nextLong()); // tight loop with many invocations.