Memos for Java Stream API

less than 1 minute read

Stream.generate

Random random = new Random();
List<Integer> numbers = Stream
    .generate(() -> random.nextInt(100))
    .limit(5)
    .collect(Collectors.toList());

Updated:

Comments