The ArrayList class has some useful methods. See the API doc.