private void treeifyBin(Node<V>[] tab, int index) {
    Node<V> b;
    int n, sc;
    if (tab != null) {
      if ((n = tab.length) < MIN_TREEIFY_CAPACITY) {
        tryPresize(n << 1);
      } else if ((b = tabAt(tab, index)) != null && b.hash >= 0) {
        synchronized (b) {
          if (tabAt(tab, index) == b) {
            TreeNode<V> hd = null, tl = null;
            for (Node<V> e = b; e != null; e = e.next) {
              TreeNode<V> p = new TreeNode<>(e.hash, e.key, null, null);
              if ((p.prev = tl) == null) {
                hd = p;
              } else {
                tl.next = p;
              }
              tl = p;
            }
            setTabAt(tab, index, new TreeBin<>(hd));
          }
        }
      }
    }
  }
Replaces all linked nodes in bin at given index unless table is too small, in which case
resizes instead.
geode-core/src/main/java/org/apache/geode/internal/concurrent/CompactConcurrentHashSet2.java