1 List<Integer> al = new ArrayList<>();
2
3 al.add(10);
4 al.add(20);
5 al.add(30);
6 al.add(1);
7 al.add(2);
8// This makes a call to remove(index) and
9// removes element 20.
10 al.remove(1);
11// Now element 30 is moved one position back
12// So element 30 is removed this time
13 al.remove(1);