class AVLGroupTree extends AbstractCollection<Centroid> implements Serializable {

    @SuppressWarnings("WeakerAccess")
    public int floorSum(long sum) {
        int floor = IntAVLTree.NIL;
        for (int node = tree.root(); node != IntAVLTree.NIL; ) {
            final int left = tree.left(node);
            final long leftCount = aggregatedCounts[left];
            if (leftCount <= sum) {
                floor = node;
                sum -= leftCount + count(node);
                node = tree.right(node);
            } else {
                node = tree.left(node);
            }
        }
        return floor;
    }

      AVLGroupTree();
      AVLGroupTree(final boolean record);

}