For instance, I have:
ArrayList intList = new ArrayList<>(Arrays.asList(0,1,2,3));
And I need to get eventually this: