Blog Archive for July 30, 2020

Streams in Java

July 30, 2020

Here's a few examples on how Streams can be used in Java.

package uk.co.drumcoder;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Test {
    public static void main(String …