presto-main/src/main/java/io/prestosql/operator/aggregation/histogram/GroupedTypedHistogram.java/GroupedTypedHistogram/ensureCapacity
class GroupedTypedHistogram:    @Override
    public void ensureCapacity(long size)
    {
        long actualSize = Math.max(numberOfGroups, size);
        this.numberOfGroups = actualSize;
        headPointers.ensureCapacity(actualSize);
        valueAndGroupHashes.ensureCapacity(actualSize);
    }