// Path: a-foundation/src/main/java/com/ajjpj/afoundation/util/AUnchecker.java
// public class AUnchecker {
//     public static void throwUnchecked(Throwable th) {
//         AUnchecker.<RuntimeException> doIt(th);
//     }
// 
//     @SuppressWarnings("unchecked")
//     private static <T extends Throwable> void doIt(Throwable th) throws T {
//         throw (T) th;
//     }
// 
//     @SuppressWarnings("unused")
//     public static void executeUnchecked(AStatement0<? extends Throwable> callback) {
//         try {
//             callback.apply();
//         }
//         catch (Throwable exc) {
//             throwUnchecked (exc);
//         }
//     }
// 
//     public static <R> R executeUnchecked(AFunction0<R, ? extends Throwable> callback) {
//         try {
//             return callback.apply();
//         }
//         catch (Throwable exc) {
//             throwUnchecked (exc);
//             return null; //for the compiler
//         }
//     }
// }


import com.ajjpj.afoundation.util.AUnchecker;
import sun.misc.Unsafe;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.concurrent.ThreadLocalRandom;
package com.ajjpj.afoundation.concurrent.jdk;




/**
 * This class bridges package visibility for ThreadLocalRandom methods
 *
 * @author arno
 */
public class ThreadLocalRandomHelper {

    public static int nextSecondarySeed() {
        int r;
        Thread t = Thread.currentThread();
        if ((r = UNSAFE.getInt(t, SECONDARY)) != 0) {
            r ^= r << 13;   // xorshift
            r ^= r >>> 17;
            r ^= r << 5;
        }
        else {
            localInit();
            if ((r = (int)UNSAFE.getLong(t, SEED)) == 0)
                r = 1; // avoid zero
        }
        UNSAFE.putInt(t, SECONDARY, r);
        return r;
    }
    public static void localInit () {
        try {
            LOCAL_INIT.invoke (null);
        }
        catch (Exception e) {
// Path: a-foundation/src/main/java/com/ajjpj/afoundation/util/AUnchecker.java
// public class AUnchecker {
//     public static void throwUnchecked(Throwable th) {
//         AUnchecker.<RuntimeException> doIt(th);
//     }
// 
//     @SuppressWarnings("unchecked")
//     private static <T extends Throwable> void doIt(Throwable th) throws T {
//         throw (T) th;
//     }
// 
//     @SuppressWarnings("unused")
//     public static void executeUnchecked(AStatement0<? extends Throwable> callback) {
//         try {
//             callback.apply();
//         }
//         catch (Throwable exc) {
//             throwUnchecked (exc);
//         }
//     }
// 
//     public static <R> R executeUnchecked(AFunction0<R, ? extends Throwable> callback) {
//         try {
//             return callback.apply();
//         }
//         catch (Throwable exc) {
//             throwUnchecked (exc);
//             return null; //for the compiler
//         }
//     }
// }


// Path: a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/ThreadLocalRandomHelper.java
import com.ajjpj.afoundation.util.AUnchecker;
import sun.misc.Unsafe;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.concurrent.ThreadLocalRandom;

package com.ajjpj.afoundation.concurrent.jdk;




/**
 * This class bridges package visibility for ThreadLocalRandom methods
 *
 * @author arno
 */
public class ThreadLocalRandomHelper {

    public static int nextSecondarySeed() {
        int r;
        Thread t = Thread.currentThread();
        if ((r = UNSAFE.getInt(t, SECONDARY)) != 0) {
            r ^= r << 13;   // xorshift
            r ^= r >>> 17;
            r ^= r << 5;
        }
        else {
            localInit();
            if ((r = (int)UNSAFE.getLong(t, SEED)) == 0)
                r = 1; // avoid zero
        }
        UNSAFE.putInt(t, SECONDARY, r);
        return r;
    }
    public static void localInit () {
        try {
            LOCAL_INIT.invoke (null);
        }
        catch (Exception e) {
            AUnchecker.throwUnchecked (e);