Source: http://web.eecs.umich.edu/~aprakash/eecs282/lectures/10-arraylists.pdf