code: protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad) {
      return nextPrime(Math.max(size+1, (int) ((4*size / (minLoad+3*maxLoad)))));
    }
docs: Chooses a new prime table capacity optimized for shrinking that (approximately) satisfies the invariant
  <tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt>
  and has at least one FREE slot for the given size.