that could be done via mouse click as well (to select a cell to subdivide)
This new grid of cells could just go into the same ArrayList (if you store the rectangle’s size also). No matter whether you store the data in two parallel ArrayLists or in one ArrayList with a class: When you init the new sub-grid within a previous cell just assign the new sub-cells the right position and size. No need to come up with a new data structure or a new ArrayList.
Even setup and draw stay the same. Just how you sub-divide is new.