// Path: src/main/java/io/usethesource/criterion/CountingInteger.java
// @CompilerControl(Mode.DONT_INLINE)
// public class CountingInteger implements JmhValue {
// 
//   private static long HASHCODE_COUNTER = 0;
//   private static long EQUALS_COUNTER = 0;
// 
//   public static void resetCounters() {
//     HASHCODE_COUNTER = 0;
//     EQUALS_COUNTER = 0;
//   }
// 
//   public static long getHashcodeCounter() {
//     return HASHCODE_COUNTER;
//   }
// 
//   public static long getEqualsCounter() {
//     return EQUALS_COUNTER;
//   }
// 
//   private int value;
// 
//   CountingInteger(int value) {
//     this.value = value;
//   }
// 
//   @Override
//   public int hashCode() {
//     HASHCODE_COUNTER++;
//     return value;
//   }
// 
//   @Override
//   public boolean equals(Object other) {
//     if (other == null) {
//       return false;
//     }
//     if (other == this) {
//       return true;
//     }
// 
//     if (other instanceof CountingInteger) {
//       int otherValue = ((CountingInteger) other).value;
// 
//       EQUALS_COUNTER++;
// 
//       return value == otherValue;
//     }
//     return false;
//   }
// 
//   @Override
//   public Object unwrap() {
//     return this; // cannot be unwrapped
//   }
// 
//   @Override
//   public String toString() {
//     return String.valueOf(value);
//   }
// 
// }


import java.util.Arrays;
import java.util.Collection;
import org.openjdk.jmh.infra.BenchmarkParams;
import org.openjdk.jmh.infra.IterationParams;
import org.openjdk.jmh.profile.InternalProfiler;
import org.openjdk.jmh.profile.ProfilerResult;
import org.openjdk.jmh.results.AggregationPolicy;
import org.openjdk.jmh.results.IterationResult;
import org.openjdk.jmh.results.Result;
import io.usethesource.criterion.CountingInteger;
/**
 * Copyright (c) Michael Steindorfer <Centrum Wiskunde & Informatica> and Contributors.
 * All rights reserved.
 *
 * This file is licensed under the BSD 2-Clause License, which accompanies this project
 * and is available under https://opensource.org/licenses/BSD-2-Clause.
 */
package io.usethesource.criterion.profiler;




public class CountingIntegerProfiler implements InternalProfiler {

  @Override
  public String getDescription() {
    return "Counts the number of hashCode() and equals() invocations on class 'CountingInteger'";
  }

  @Override
  public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
// Path: src/main/java/io/usethesource/criterion/CountingInteger.java
// @CompilerControl(Mode.DONT_INLINE)
// public class CountingInteger implements JmhValue {
// 
//   private static long HASHCODE_COUNTER = 0;
//   private static long EQUALS_COUNTER = 0;
// 
//   public static void resetCounters() {
//     HASHCODE_COUNTER = 0;
//     EQUALS_COUNTER = 0;
//   }
// 
//   public static long getHashcodeCounter() {
//     return HASHCODE_COUNTER;
//   }
// 
//   public static long getEqualsCounter() {
//     return EQUALS_COUNTER;
//   }
// 
//   private int value;
// 
//   CountingInteger(int value) {
//     this.value = value;
//   }
// 
//   @Override
//   public int hashCode() {
//     HASHCODE_COUNTER++;
//     return value;
//   }
// 
//   @Override
//   public boolean equals(Object other) {
//     if (other == null) {
//       return false;
//     }
//     if (other == this) {
//       return true;
//     }
// 
//     if (other instanceof CountingInteger) {
//       int otherValue = ((CountingInteger) other).value;
// 
//       EQUALS_COUNTER++;
// 
//       return value == otherValue;
//     }
//     return false;
//   }
// 
//   @Override
//   public Object unwrap() {
//     return this; // cannot be unwrapped
//   }
// 
//   @Override
//   public String toString() {
//     return String.valueOf(value);
//   }
// 
// }


// Path: src/main/java/io/usethesource/criterion/profiler/CountingIntegerProfiler.java
import java.util.Arrays;
import java.util.Collection;
import org.openjdk.jmh.infra.BenchmarkParams;
import org.openjdk.jmh.infra.IterationParams;
import org.openjdk.jmh.profile.InternalProfiler;
import org.openjdk.jmh.profile.ProfilerResult;
import org.openjdk.jmh.results.AggregationPolicy;
import org.openjdk.jmh.results.IterationResult;
import org.openjdk.jmh.results.Result;
import io.usethesource.criterion.CountingInteger;

/**
 * Copyright (c) Michael Steindorfer <Centrum Wiskunde & Informatica> and Contributors.
 * All rights reserved.
 *
 * This file is licensed under the BSD 2-Clause License, which accompanies this project
 * and is available under https://opensource.org/licenses/BSD-2-Clause.
 */
package io.usethesource.criterion.profiler;




public class CountingIntegerProfiler implements InternalProfiler {

  @Override
  public String getDescription() {
    return "Counts the number of hashCode() and equals() invocations on class 'CountingInteger'";
  }

  @Override
  public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
    CountingInteger.resetCounters();