functional interface in Java

Java defines a functional interface as an interface that contains a single abstract method. From Java 8 onwards, lambda expressions can be used to represent the instance of a functional interface.
* Default methods or static methods do not count.
* If an interface declares an abstract method overriding one of the public methods of java.lang.Object, such as equals() or toString(), that also does not count toward the interface' abstract method since any implementation of the interface will have an implementation from java.lang.Object or elsewhere. 
* Functional interfaces are used as the basis for lambda expressions in functional programming. When a lambda expression targets a functional interface, all the parameters must be exactly the same. The only exception is that an array type is interchangeable with a varargs.
```
interface Calculable {
    int change(int i);
    default int change(short i) {
        return i * 3;
    }
}

class Main {
    public static void main(String[] args) {
        Calculable calculable = i -> i * 2;
        System.out.println(calculable.change(10)); // 20
    }
}
```
Common functional interfaces:
Functional Interfaces | # Parameters | Return Type | Single Abstract Method
------ | ------ | ------ | ------
Supplier<T> | 0 | T | get
Consumer<T> | 1 (T) | void | accept
BiConsumer<T, U> | 2 (T, U) | void | accept
Predicate<T> | 1 (T) | boolean | test
BiPredicate<T, U> | 2 (T, U) | boolean | test
Function<T, R> | 1 (T) | R | apply
BiFunction<T, U, R> | 2 (T, U) | R | apply
UnaryOperator<T> | 1 (T) | T | apply
BinaryOperator<T> | 2 (T, T) | T | apply