Returns a prime number which is very close to <code>desiredCapacity</code> with detailed steps between
{1-8191}

@param desiredCapacity the capacity desired by the user.
@return the capacity which should be used for a hash.
421852
public static final int nextPrime8191(final int desiredCapacity) {
		if (desiredCapacity < 0)
			return 1;
		if (desiredCapacity <= 8191) {
			final int i = Arrays.binarySearch(primeCapacities8191, (short) desiredCapacity);
			return primeCapacities8191[((i < 0) ? ((-i) - 1) : i)];
		}
		return nextPrime(desiredCapacity);
	}
474398
public static void checkCapacity(final int capacity)
    {
        if (!BitUtil.isPowerOfTwo(capacity))
        {
            final String msg = "capacity must be a positive power of 2 + TRAILER_LENGTH: capacity=" + capacity;
            throw new IllegalStateException(msg);
        }
    }
532153
@VisibleForTesting
    static int capacity(int expectedSize) {
        if (expectedSize < 3) {
            checkNonnegative(expectedSize, "expectedSize");
            return expectedSize + 1;
        }
        if (expectedSize < MAX_POWER_OF_TWO) {
            return expectedSize + expectedSize / 3;
        }
        return Integer.MAX_VALUE; // any large value
    }
584950
public int remainderSize() {
	    BigDecimal fraction = remainder();
		String tmp = fraction.toString();
		int n = tmp.indexOf(Properties.DEFAULT_DECIMAL_SEPARATOR);
		if (n != -1) {
			return tmp.length() - n - 1;
		} else
			return 0;
	}
693208
private void ensureCapacity(int requestedCapacity) {

        if (requestedCapacity > getCapacity()) {
            int newCapacity = getCapacity();
            while (requestedCapacity > newCapacity) {
                newCapacity = (newCapacity * 3) / 2;
            }
            reallocateBuffer(newCapacity);
        }
    }
262803
private int minimumFnRemove(int[] h) {
    int minIndex = Integer.MAX_VALUE;
    double minValue = Double.MAX_VALUE;

    for (int i = 0; i < nbHash; i++) {
      double keyWeight = getWeight(keyVector[h[i]]);

      if (keyWeight < minValue) {
        minIndex = h[i];
        minValue = keyWeight;
      }

    }

    return minIndex;
  }
867504
public static int minimumRequestSize(Request request) {

    // Header and payload are common inside a Frame at the protocol level

    // Frame header has a fixed size of 9 for protocol version >= V3, which includes Frame flags
    // size
    int size = FrameCodec.headerEncodedSize();

    if (!request.getCustomPayload().isEmpty()) {
      // Custom payload is not supported in v3, but assume user won't have a custom payload set if
      // they use this version
      size += PrimitiveSizes.sizeOfBytesMap(request.getCustomPayload());
    }

    return size;
  }
1007973
public static PrimeNumberSieve getInstance() {
        return new PrimeNumberSieve() {
            @Override
            public PSArray<Integer> calcList(int max) {
                boolean[] prime = new boolean[max + 1];
                Arrays.fill(prime, true);
                prime[0] = false;
                prime[1] = false;
                for (int i = 2; i <= max; i++)
                    if (prime[i])
                        for (int j = i + i; j <= max; j += i)
                            prime[j] = false;
                return toArray(max, prime);
            }
        };
    }
374738
public static double getFalsePositiveProbability(int bucketsPerElement, int hashCount) {
        // (1 - e^(-k * n / m)) ^ k
        return Math.pow(1 - Math.exp(-hashCount * (1 / (double) bucketsPerElement)), hashCount);

    }
630097
public DataLoader<K, V> prime(K key, V value) {
        Object cacheKey = getCacheKey(key);
        synchronized (this) {
            if (!futureCache.containsKey(cacheKey)) {
                futureCache.set(cacheKey, CompletableFuture.completedFuture(value));
            }
        }
        return this;
    }
530305
private void grow(int minCapacity) {
        int oldCapacity = queue.length;
        // Double size if small; else grow by 50%
        int newCapacity = oldCapacity + ((oldCapacity < 64) ?
                                         (oldCapacity + 2) :
                                         (oldCapacity >> 1));
        // overflow-conscious code
        if (newCapacity - MAX_ARRAY_SIZE > 0)
            newCapacity = hugeCapacity(minCapacity);
        queue = Arrays.copyOf(queue, newCapacity);
    }
64809
public StorageSize multiply(BigInteger by)
	{
		final BigInteger result = getBits().multiply(by);

		return new StorageSize(getUnit(), result);
	}
804555
public java.util.List<CapacityReservation> getCapacityReservations() {
        if (capacityReservations == null) {
            capacityReservations = new com.amazonaws.internal.SdkInternalList<CapacityReservation>();
        }
        return capacityReservations;
    }
678958
public synchronized int get() {
        if (available == 0) {
            return -1;
        }
        byte value = buffer[idxGet];
        idxGet = (idxGet + 1) % capacity;
        available--;
        return value;
    }
1314843
public BigDecimal get(JcNumber number) {
		Object val = this.getFor(number);
		if (val != null)
			return (BigDecimal)val;
		return null;
	}
1227030
protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) {
    return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad)))));
  }
590046
public Optional<BigDecimal> getMax() {
        if (property instanceof BaseIntegerProperty) {
            BaseIntegerProperty integerProperty = (BaseIntegerProperty) property;
            return Optional.ofNullable(integerProperty.getMaximum() != null ? integerProperty.getMaximum() : null);
        } else if (property instanceof AbstractNumericProperty) {
            AbstractNumericProperty numericProperty = (AbstractNumericProperty) property;
            return Optional.ofNullable(numericProperty.getMaximum());
        }
        return Optional.empty();
    }