Iterating the ArrayList and HashMap