java hashmap.put return list code example Example: how to create an array list in java List<Integer> list = new ArrayList<>();