class Randomness {

    private static final Method CURRENT_METHOD;
    private static final Method GET_RANDOM_METHOD;

    static {
        Method maybeCurrentMethod;
        Method maybeGetRandomMethod;
        try {
            Class<?> clazz = Class.forName("com.carrotsearch.randomizedtesting.RandomizedContext");
            maybeCurrentMethod = clazz.getMethod("current");
            maybeGetRandomMethod = clazz.getMethod("getRandom");
        } catch (Exception e) {
            maybeCurrentMethod = null;
            maybeGetRandomMethod = null;
        }
        CURRENT_METHOD = maybeCurrentMethod;
        GET_RANDOM_METHOD = maybeGetRandomMethod;
    }

    private Randomness() {
    }

    /**
     * Provides a reproducible source of randomness seeded by a long
     * seed in the settings with the key setting.
     *
     * @param settings the settings containing the seed
     * @param setting  the setting to access the seed
     * @return a reproducible source of randomness
     */
    public static Random get(Settings settings, Setting<Long> setting) {
        if (setting.exists(settings)) {
            return new Random(setting.get(settings));
        } else {
            return get();
        }
    }

    /**
     * Provides a source of randomness that is reproducible when
     * running under the Elasticsearch test suite, and otherwise
     * produces a non-reproducible source of randomness. Reproducible
     * sources of randomness are created when the system property
     * "tests.seed" is set and the security policy allows reading this
     * system property. Otherwise, non-reproducible sources of
     * randomness are created.
     *
     * @return a source of randomness
     * @throws IllegalStateException if running tests but was not able
     *                               to acquire an instance of Random from
     *                               RandomizedContext or tests are
     *                               running but tests.seed is not set
     */
    public static Random get() {<FILL_FUNCTION_BODY>}

    /**
     * Provides a secure source of randomness.
     *
     * This acts exactly similar to {@link #get()}, but returning a new {@link SecureRandom}.
     */
    public static SecureRandom createSecure() {
        if (CURRENT_METHOD != null && GET_RANDOM_METHOD != null) {
            // tests, so just use a seed from the non secure random
            byte[] seed = new byte[16];
            get().nextBytes(seed);
            return new SecureRandom(seed);
        } else {
            return new SecureRandom();
        }
    }

    @SuppressForbidden(reason = "ThreadLocalRandom is okay when not running tests")
    private static Random getWithoutSeed() {
        assert CURRENT_METHOD == null && GET_RANDOM_METHOD == null : "running under tests but tried to create non-reproducible random";
        return ThreadLocalRandom.current();
    }

    public static void shuffle(List<?> list) {
        Collections.shuffle(list, get());
    }
}

        if (CURRENT_METHOD != null && GET_RANDOM_METHOD != null) {
            try {
                Object randomizedContext = CURRENT_METHOD.invoke(null);
                return (Random) GET_RANDOM_METHOD.invoke(randomizedContext);
            } catch (ReflectiveOperationException e) {
                // unexpected, bail
                throw new IllegalStateException("running tests but failed to invoke RandomizedContext#getRandom", e);
            }
        } else {
            return getWithoutSeed();
        }
    
<no_super_class>