Function is a functional interface that takes an input and gives an output. so functions can be chained.

Transcribed from the original LinkedIn image post.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import java.io.IOException;
import java.util.function.Function;

public class Day10 {
    public static void main(String[] args) throws IOException, InterruptedException {
        Function<String, String> stringFunction = String::trim;
        Function<String, Boolean> stringFunctionChar = stringFunction
            .andThen(String::toLowerCase)
            .andThen(s -> s.contains("function"));

        Boolean check = stringFunctionChar.apply("A string to put in function");
        System.out.println(check.booleanValue());
    }
}

The original LinkedIn graphic is preserved below.

Day 10 LinkedIn post