class ChunkArray<T>
{
    private static int chunkSize = 4096;//this must be a power of 2, otherwise can't optimize row and col functions
    private static int divShift = 12;   // number of bits to shift right to do division by chunkSize (the bit position of chunkSize)
    public SuggestionStage.Node[][] values;             // Note: Node (SymSpell.SuggestionStage.Node) is found in SymSpell.SymSpell.java.
    public int count;

    ChunkArray(int initialCapacity)
    {
        int chunks = (initialCapacity + chunkSize - 1) / chunkSize;
        values = new SuggestionStage.Node[chunks][];
        for (int i = 0; i < values.length; i++) values[i] = new Node[chunkSize];
    }

    public int add(Node value)
    {<FILL_FUNCTION_BODY>}

    public void clear()
    {
        count = 0;
    }

    public Node getValues(int index) {
        return values[row(index)][col(index)];
    }
    public void setValues(int index, Node value){
        values[row(index)][col(index)] = value;
    }
    public void setValues(int index, Node value, Node[][] list){
        list[row(index)][col(index)] = value;
    }

    private int row(int index) { return index >> divShift; } // same as index / chunkSize
    private int col(int index) { return index & (chunkSize - 1); } //same as index % chunkSize
    private int capacity() { return values.length * chunkSize; }
}

        if (count == capacity()) {
            Node[][] newValues = Arrays.copyOf(values, values.length + 1);
            newValues[values.length] = new Node[chunkSize];
            values = newValues;
        }

        values[row(count)][col(count)] = value;
        count++;
        return count - 1;
    
<no_super_class>