// Path: src/main/java/io/usethesource/criterion/BenchmarkUtils.java
// public static int seedFromSizeAndRun(int size, int run) {
//   return mix(size) ^ mix(run);
// }
// 
// Path: src/main/java/io/usethesource/criterion/api/JmhValue.java
// @CompilerControl(Mode.DONT_INLINE)
// public interface JmhValue {
// 
//   /**
//    * Removes the JmhValue delegation object to reveal its internal representation.
//    *
//    * @return internal representation
//    */
//   Object unwrap();
// 
// }
// 
// Path: src/main/java/io/usethesource/criterion/generators/JmhIntegerGenerator.java
// public class JmhIntegerGenerator extends Generator<JmhValue> {
// 
//   public JmhIntegerGenerator() {
//     super(JmhValue.class);
//   }
// 
//   @Override
//   public JmhValue generate(SourceOfRandomness random, GenerationStatus status) {
//     return new PureInteger(random.nextInt());
//   }
// 
// }


import static io.usethesource.criterion.BenchmarkUtils.seedFromSizeAndRun;
import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;
import com.pholser.junit.quickcheck.generator.GenerationStatus;
import com.pholser.junit.quickcheck.generator.Generator;
import com.pholser.junit.quickcheck.internal.GeometricDistribution;
import com.pholser.junit.quickcheck.internal.generator.SimpleGenerationStatus;
import com.pholser.junit.quickcheck.random.SourceOfRandomness;
import io.usethesource.capsule.Set;
import io.usethesource.capsule.api.TernaryRelation;
import io.usethesource.capsule.api.Triple;
import io.usethesource.capsule.generators.SingletonToTripleGenerator;
import io.usethesource.capsule.generators.relation.AbstractTernaryRelationGenerator;
import io.usethesource.capsule.generators.relation.TernaryTrieSetMultimapGenerator;
import io.usethesource.capsule.util.stream.CapsuleCollectors;
import io.usethesource.criterion.api.JmhValue;
import io.usethesource.criterion.generators.JmhIntegerGenerator;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;
    }

    // assert (contained)
    assert Stream.of(cachedNumbers)
        .allMatch(sample -> testMap.contains(Triple.of(sample, sample, sample)));

    /*
     * generate random integers that are not yet contained in the data set
     */
    for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
      boolean found = false;
      while (!found) {
        final JmhValue candidate = itemGenerator.generate(random, status);

        if (!elements.contains(candidate)) {
          cachedNumbersNotContained[i] = candidate;
          found = true;
        }
      }
    }

    // assert (contained)
    assert Stream.of(cachedNumbersNotContained)
        .noneMatch(sample -> testMap.contains(Triple.of(sample, sample, sample)));

    VALUE_EXISTING = cachedNumbers[0];
    VALUE_NOT_EXISTING = cachedNumbersNotContained[0];
  }

  private final Supplier<SourceOfRandomness> freshRandom = () -> new SourceOfRandomness(
// Path: src/main/java/io/usethesource/criterion/BenchmarkUtils.java
// public static int seedFromSizeAndRun(int size, int run) {
//   return mix(size) ^ mix(run);
// }
// 
// Path: src/main/java/io/usethesource/criterion/api/JmhValue.java
// @CompilerControl(Mode.DONT_INLINE)
// public interface JmhValue {
// 
//   /**
//    * Removes the JmhValue delegation object to reveal its internal representation.
//    *
//    * @return internal representation
//    */
//   Object unwrap();
// 
// }
// 
// Path: src/main/java/io/usethesource/criterion/generators/JmhIntegerGenerator.java
// public class JmhIntegerGenerator extends Generator<JmhValue> {
// 
//   public JmhIntegerGenerator() {
//     super(JmhValue.class);
//   }
// 
//   @Override
//   public JmhValue generate(SourceOfRandomness random, GenerationStatus status) {
//     return new PureInteger(random.nextInt());
//   }
// 
// }


// Path: src/main/java/io/usethesource/criterion/JmhTernaryRelationBenchmarks.java
import static io.usethesource.criterion.BenchmarkUtils.seedFromSizeAndRun;
import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;
import com.pholser.junit.quickcheck.generator.GenerationStatus;
import com.pholser.junit.quickcheck.generator.Generator;
import com.pholser.junit.quickcheck.internal.GeometricDistribution;
import com.pholser.junit.quickcheck.internal.generator.SimpleGenerationStatus;
import com.pholser.junit.quickcheck.random.SourceOfRandomness;
import io.usethesource.capsule.Set;
import io.usethesource.capsule.api.TernaryRelation;
import io.usethesource.capsule.api.Triple;
import io.usethesource.capsule.generators.SingletonToTripleGenerator;
import io.usethesource.capsule.generators.relation.AbstractTernaryRelationGenerator;
import io.usethesource.capsule.generators.relation.TernaryTrieSetMultimapGenerator;
import io.usethesource.capsule.util.stream.CapsuleCollectors;
import io.usethesource.criterion.api.JmhValue;
import io.usethesource.criterion.generators.JmhIntegerGenerator;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.TimeValue;

    }

    // assert (contained)
    assert Stream.of(cachedNumbers)
        .allMatch(sample -> testMap.contains(Triple.of(sample, sample, sample)));

    /*
     * generate random integers that are not yet contained in the data set
     */
    for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
      boolean found = false;
      while (!found) {
        final JmhValue candidate = itemGenerator.generate(random, status);

        if (!elements.contains(candidate)) {
          cachedNumbersNotContained[i] = candidate;
          found = true;
        }
      }
    }

    // assert (contained)
    assert Stream.of(cachedNumbersNotContained)
        .noneMatch(sample -> testMap.contains(Triple.of(sample, sample, sample)));

    VALUE_EXISTING = cachedNumbers[0];
    VALUE_NOT_EXISTING = cachedNumbersNotContained[0];
  }

  private final Supplier<SourceOfRandomness> freshRandom = () -> new SourceOfRandomness(
      new Random(seedFromSizeAndRun(size, run)));