package com.carrotsearch.hppc;


public final class TightRandomResizingStrategy implements ArraySizingStrategy {
  private final int maxRandomIncrement;
  public int growCalls;

  public TightRandomResizingStrategy(int maxRandomIncrement) {
    this.maxRandomIncrement = maxRandomIncrement;
  }
  
  public TightRandomResizingStrategy() {
    this(10);
  }
  
  @Override
  public int round(int expectedElements) {
    return expectedElements;
  }

  @Override
  public int grow(int currentBufferLength, int elementsCount, int expectedAdditions) {
    growCalls++;
    // System.out.println(String.format(Locale.ROOT, "%d %d %d", currentBufferLength, elementsCount, expectedAdditions));
    return Math.max(currentBufferLength, elementsCount + expectedAdditions) 
        + KTypeArrayDequeTest.randomIntBetween(0, maxRandomIncrement);
  }
}
@@ -27,16 +27,80 @@
 ppc;%0D%0A%0D%0A
+import com.carrotsearch.randomizedtesting.RandomizedContext;%0D%0A%0D%0A
 %0D%0Apublic
@@ -768,16 +768,157 @@
 ons));%0D%0A
+    int r = 0;%0D%0A    if (maxRandomIncrement %3E 0) %7B%0D%0A      r += RandomizedContext.current().getRandom().nextInt(maxRandomIncrement);%0D%0A    %7D%0D%0A%0D%0A
     retu
@@ -989,79 +989,11 @@
 ns) 
-%0D%0A        + KTypeArrayDequeTest.randomIntBetween(0, maxRandomIncrement)
++ r
 ;%0D%0A 

Fix compilation error.