public void solution(){ List<Integer> givenList = Arrays.asList(1, 2, 3,4,5,6); Collections.shuffle(givenList); int randomSeriesLength = 3; List<Integer> randomSeries = givenList.subList(0, randomSeriesLength); }