Write Array class (a thin generic wrapper around raw arrays) and alter ArrayList to use this new class.
Re-write as a simple concrete class.
Added comments.