So I got a bit creative and wanted to re-create some methods in Java and I got stuck with add().
My idea is to check first if we need more size then add (if we need).
After that copy the initial array and then shift the indexes and numbers in the array, but I frankly have no idea how to do that so that's why I'm asking here.
javap -v java.util.ArrayList. That may help you see what it's doing under the covers.