Working with ArrayList and its methods