void (String[] args) { List<Integer>[] li = new List[N]; for (int i = 0; i < N; ++i) { li[i] = new ArrayList<Integer>(); } Integer[] values = new Integer[N]; for (int i = 0; i < N; ++i) { values[i] = i; } //This loop is highlighted. for (int i = 1; i < N; ++i) { li[nextInt()].add(values[i]); } }