List<Integer> res = new ArrayList<>();
int[] arr = res.stream().mapToInt(i -> i).toArray()