public static <T> List<T> duplicate(final List<T> list, final int times) {
        return list.stream().flatMap(e -> Collections.nCopies(times, e).stream()).collect(toList());
    }
(**) Duplicate the elements of a list a given number of times.
<pre>
         duplicate(Arrays.asList("a", "b", "c", "d"))
</pre>
java8/src/main/java/com/shekhargulati/ninetynine_problems/_01_lists/P15.java