You can achieve using flatMap :
List<Integer> result = list.stream().flatMap(i -> Stream.of(i,i,i,i)).collect(Collectors.toList());
or more generally:
List<Integer> result = list.stream().flatMap(i -> Stream.generate(() -> i).limit(4)).collect(Collectors.toList());
For each element in the input list, a stream is created consisting of this element, which is repeated 4 times, and flat ones display it. Then all the items are collected in a list.
source share