// Path: fast-rng-test/src/main/java/biz/k11i/rng/test/gof/GoodnessOfFitTest.java
// @SuppressWarnings("unused")
// public abstract class GoodnessOfFitTest {
//     static class BuilderBase<SELF extends BuilderBase<SELF>> {
//         @SuppressWarnings("unchecked")
//         private final SELF self = (SELF) this;
// 
//         int numRandomValues;
//         double significanceLevel = DEFAULT_SIGNIFICANCE_LEVEL;
// 
//         public SELF numRandomValues(int numRandomValues) {
//             this.numRandomValues = numRandomValues;
//             return self;
//         }
// 
//         public SELF significanceLevel(double significanceLevel) {
//             this.significanceLevel = significanceLevel;
//             return self;
//         }
//     }
// 
//     /** Default significance level (0.1%) */
//     private static final double DEFAULT_SIGNIFICANCE_LEVEL = 0.001;
// 
//     /** Name of the random number generator to be tested */
//     public final String rngName;
// 
//     /** Significance level to reject the null hypothesis */
//     public final double significanceLevel;
// 
//     GoodnessOfFitTest(String rngName, double significanceLevel) {
//         this.rngName = rngName;
//         this.significanceLevel = significanceLevel;
//     }
// 
//     /**
//      * Returns {@link ContinuousGofTest} builder object.
//      *
//      * @return builder object.
//      */
//     public static ContinuousGofTest.Builder continuous() {
//         return new ContinuousGofTest.Builder();
//     }
// 
//     /**
//      * Returns {@link DiscreteGofTest} builder object.
//      *
//      * @return builder obbject.
//      */
//     public static DiscreteGofTest.Builder discrete() {
//         return new DiscreteGofTest.Builder();
//     }
// 
//     /**
//      * Calculate p-values of Goodness-of-Fit test.
//      *
//      * @return test result.
//      */
//     public abstract Map<String, Double> test();
// 
//     /**
//      * Calculate p-values of Goodness-of-Fit test in parallel.
//      *
//      * @return test result.
//      */
//     public Map<String, Double> testInParallel() {
//         ForkJoinPool pool = new ForkJoinPool();
//         try {
//             return testInParallel(pool);
// 
//         } finally {
//             pool.shutdown();
//             try {
//                 pool.awaitTermination(1, TimeUnit.SECONDS);
//             } catch (InterruptedException ignore) {
//             }
//         }
//     }
// 
//     /**
//      * Calculate p-values of Goodness-of-Fit test in parallel using given {@link ForkJoinPool} instance.
//      *
//      * @param pool Fork/Join pool to execute tasks in paralle.
//      * @return test result.
//      */
//     public abstract Map<String, Double> testInParallel(ForkJoinPool pool);
// 
//     /**
//      * Runs Goodness-of-Fit tests and verifis whether the test failed to reject the null hypothesis
//      * (which means the random sequence that was generated by random number generator can be described as random) or not.
//      */
//     public void testAndVerify() {
//         Map<String, Double> result = test();
// 
//         result.forEach((t, p) ->
//                 assertThat(p)
//                         .describedAs("At a significance level of %e, the Goodness-of-Fit test of [%s] should fail to reject null hypothesis (The p-value %f should be greater than or equal to %e).\n" +
//                                         "This means that the random sequence generated by the random number generator [%s] fit the theoretical probability distribution.",
//                                 significanceLevel, t, p, significanceLevel,
//                                 rngName)
//                         .isGreaterThanOrEqualTo(significanceLevel));
//     }
// }
// 
// Path: fast-rng-test/src/main/java/biz/k11i/rng/test/util/distribution/ProbabilityDistributions.java
// public interface ProbabilityDistributions {
//     static ContinuousDistribution gaussian(double mean, double sd) {
//         return new Gaussian(mean, sd);
//     }
// 
//     static ContinuousDistribution gamma(double shape, double scale) {
//         return new Gamma(shape, scale);
//     }
// 
//     static ContinuousDistribution beta(double alpha, double beta) {
//         return new Beta(alpha, beta);
//     }
// 
//     static ContinuousDistribution wrap(RealDistribution distribution) {
//         return new CommonsMath3DistributionWrapper.Continuous(distribution);
//     }
// 
//     static DiscreteDistribution wrap(IntegerDistribution distribution) {
//         return new CommonsMath3DistributionWrapper.Discrete(distribution);
//     }
// }


import biz.k11i.rng.test.gof.GoodnessOfFitTest;
import biz.k11i.rng.test.util.distribution.ProbabilityDistributions;
import org.junit.jupiter.api.Test;
import java.util.Random;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
package biz.k11i.rng.test;




class SecondLevelTestTest {
    @Test
    void test() {
        GoodnessOfFitTest gofTest = GoodnessOfFitTest.continuous()
// Path: fast-rng-test/src/main/java/biz/k11i/rng/test/gof/GoodnessOfFitTest.java
// @SuppressWarnings("unused")
// public abstract class GoodnessOfFitTest {
//     static class BuilderBase<SELF extends BuilderBase<SELF>> {
//         @SuppressWarnings("unchecked")
//         private final SELF self = (SELF) this;
// 
//         int numRandomValues;
//         double significanceLevel = DEFAULT_SIGNIFICANCE_LEVEL;
// 
//         public SELF numRandomValues(int numRandomValues) {
//             this.numRandomValues = numRandomValues;
//             return self;
//         }
// 
//         public SELF significanceLevel(double significanceLevel) {
//             this.significanceLevel = significanceLevel;
//             return self;
//         }
//     }
// 
//     /** Default significance level (0.1%) */
//     private static final double DEFAULT_SIGNIFICANCE_LEVEL = 0.001;
// 
//     /** Name of the random number generator to be tested */
//     public final String rngName;
// 
//     /** Significance level to reject the null hypothesis */
//     public final double significanceLevel;
// 
//     GoodnessOfFitTest(String rngName, double significanceLevel) {
//         this.rngName = rngName;
//         this.significanceLevel = significanceLevel;
//     }
// 
//     /**
//      * Returns {@link ContinuousGofTest} builder object.
//      *
//      * @return builder object.
//      */
//     public static ContinuousGofTest.Builder continuous() {
//         return new ContinuousGofTest.Builder();
//     }
// 
//     /**
//      * Returns {@link DiscreteGofTest} builder object.
//      *
//      * @return builder obbject.
//      */
//     public static DiscreteGofTest.Builder discrete() {
//         return new DiscreteGofTest.Builder();
//     }
// 
//     /**
//      * Calculate p-values of Goodness-of-Fit test.
//      *
//      * @return test result.
//      */
//     public abstract Map<String, Double> test();
// 
//     /**
//      * Calculate p-values of Goodness-of-Fit test in parallel.
//      *
//      * @return test result.
//      */
//     public Map<String, Double> testInParallel() {
//         ForkJoinPool pool = new ForkJoinPool();
//         try {
//             return testInParallel(pool);
// 
//         } finally {
//             pool.shutdown();
//             try {
//                 pool.awaitTermination(1, TimeUnit.SECONDS);
//             } catch (InterruptedException ignore) {
//             }
//         }
//     }
// 
//     /**
//      * Calculate p-values of Goodness-of-Fit test in parallel using given {@link ForkJoinPool} instance.
//      *
//      * @param pool Fork/Join pool to execute tasks in paralle.
//      * @return test result.
//      */
//     public abstract Map<String, Double> testInParallel(ForkJoinPool pool);
// 
//     /**
//      * Runs Goodness-of-Fit tests and verifis whether the test failed to reject the null hypothesis
//      * (which means the random sequence that was generated by random number generator can be described as random) or not.
//      */
//     public void testAndVerify() {
//         Map<String, Double> result = test();
// 
//         result.forEach((t, p) ->
//                 assertThat(p)
//                         .describedAs("At a significance level of %e, the Goodness-of-Fit test of [%s] should fail to reject null hypothesis (The p-value %f should be greater than or equal to %e).\n" +
//                                         "This means that the random sequence generated by the random number generator [%s] fit the theoretical probability distribution.",
//                                 significanceLevel, t, p, significanceLevel,
//                                 rngName)
//                         .isGreaterThanOrEqualTo(significanceLevel));
//     }
// }
// 
// Path: fast-rng-test/src/main/java/biz/k11i/rng/test/util/distribution/ProbabilityDistributions.java
// public interface ProbabilityDistributions {
//     static ContinuousDistribution gaussian(double mean, double sd) {
//         return new Gaussian(mean, sd);
//     }
// 
//     static ContinuousDistribution gamma(double shape, double scale) {
//         return new Gamma(shape, scale);
//     }
// 
//     static ContinuousDistribution beta(double alpha, double beta) {
//         return new Beta(alpha, beta);
//     }
// 
//     static ContinuousDistribution wrap(RealDistribution distribution) {
//         return new CommonsMath3DistributionWrapper.Continuous(distribution);
//     }
// 
//     static DiscreteDistribution wrap(IntegerDistribution distribution) {
//         return new CommonsMath3DistributionWrapper.Discrete(distribution);
//     }
// }


// Path: fast-rng-test/src/test/java/biz/k11i/rng/test/SecondLevelTestTest.java
import biz.k11i.rng.test.gof.GoodnessOfFitTest;
import biz.k11i.rng.test.util.distribution.ProbabilityDistributions;
import org.junit.jupiter.api.Test;
import java.util.Random;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

package biz.k11i.rng.test;




class SecondLevelTestTest {
    @Test
    void test() {
        GoodnessOfFitTest gofTest = GoodnessOfFitTest.continuous()
                .probabilityDistribution(ProbabilityDistributions.gaussian(0.0, 1.002 /* not 1.0 */))