private void tryPresize(int size) {
    int c = (size >= (MAXIMUM_CAPACITY >>> 1)) ? MAXIMUM_CAPACITY
        : tableSizeFor(size + (size >>> 1) + 1);
    int sc;
    while ((sc = sizeCtl) >= 0) {
      Node<V>[] tab = table;
      int n;
      if (tab == null || (n = tab.length) == 0) {
        n = (sc > c) ? sc : c;
        if (U.compareAndSwapInt(this, SIZECTL, sc, -1)) {
          try {
            if (table == tab) {
              @SuppressWarnings("unchecked")
              Node<V>[] nt = (Node<V>[]) new Node<?>[n];
              table = nt;
              sc = n - (n >>> 2);
            }
          } finally {
            sizeCtl = sc;
          }
        }
      } else if (c <= sc || n >= MAXIMUM_CAPACITY) {
        break;
      } else if (tab == table) {
        int rs = resizeStamp(n);
        if (U.compareAndSwapInt(this, SIZECTL, sc, (rs << RESIZE_STAMP_SHIFT) + 2)) {
          transfer(tab, null);
        }
      }
    }
  }
Tries to presize table to accommodate the given number of elements.

@param size number of elements (doesn't need to be perfectly accurate)
geode-core/src/main/java/org/apache/geode/internal/concurrent/CompactConcurrentHashSet2.java