Visibility For-each loops Autoboxing Static Import
The static import construct allows unqualified access to static members without inheriting from the type containing the static members. Instead, the program imports the members, either individually:
import static java.lang.Math.PI;
import static java.lang.Math.cos;
or en masse:
import static java.lang.Math.*;
Once the static members have been imported, they may be used without qualification:
double r = cos(PI * theta);
(instead of
double r = Math.cos(Math.PI * theta);
)
This should be used sparingly since it pollutes the namespace of the class.

Modifiers Strings Varargs
Exceptions
Lambda expressions
Regular Expressions
Functional interfaces
Optional
static <T> Optional<T> of(T value)Returns an Optional describing the given non-null value.
static <T> Optional<T> ofNullable(T value)Returns an Optional describing the given value, if non-null, otherwise returns an empty Optional.
static <T> Optional<T> empty()Returns an empty Optional instance.
boolean isEmpty()If a value is not present, returns true, otherwise false.
boolean isPresent()If a value is present, returns true, otherwise false.
T get()If a value is present, returns the value, otherwise throws NoSuchElementException.
T orElse(T other)If a value is present, returns the value, otherwise returns other.
T orElseGet(Supplier<? extends T> supplier)If a value is present, returns the value, otherwise returns the result produced by the supplying function.
Optional<T> or(Supplier<? extends Optional<? extends T>> supplier)If a value is present, returns an Optional describing the value, otherwise returns an Optional produced by the supplying function.
T orElseThrow()If a value is present, returns the value, otherwise throws NoSuchElementException.
<X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier)If a value is present, returns the value, otherwise throws an exception produced by the exception supplying function.
void ifPresentOrElse(Consumer<? super T> action, Runnable emptyAction)If a value is present, performs the given action with the value, otherwise performs the given empty-based action.
employee.ifPresentOrElse(
    emp -> log.debug("Found Employee: {}",emp.getName()),
    () -> log.error("Employee not found"));
Optional<T> filter(Predicate<? super T> predicate)If a value is present, and the value matches the given predicate, returns an Optional describing the value, otherwise returns an empty Optional.
<U> Optional<U> map(Function<? super T,? extends U> mapper)If a value is present, returns an Optional describing (as if by ofNullable(T)) the result of applying the given mapping function to the value, otherwise returns an empty Optional.
<U> Optional<U> flatMap(Function<? super T,? extends Optional<? extends U>> mapper)If a value is present, returns the result of applying the given Optional-bearing mapping function to the value, otherwise returns an empty Optional.
There are also the following classes: Stream
static <T> Stream<T> concat(Stream<? extends T> a, Stream<? extends T> b)Creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream.
boolean allMatch(Predicate<? super T> predicate)Returns whether all elements of this stream match the provided predicate.
boolean anyMatch(Predicate<? super T> predicate)Returns whether any elements of this stream match the provided predicate.
<R> Stream<R> map(Function<? super T,? extends R> mapper)Returns a stream consisting of the results of applying the given function to the elements of this stream.
<R> Stream<R> flatMap(Function<? super T,? extends Stream<? extends R>> mapper)Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.
Stream<String> lines = Files.lines(path, StandardCharsets.UTF_8);
Stream<String> words = lines.flatMap(line -> Stream.of(line.split(" +")));
default <R> Stream<R> mapMulti(BiConsumer<? super T,? super Consumer<R>> mapper)Returns a stream consisting of the results of replacing each element of this stream with multiple elements, specifically zero or more elements.
Stream<Number> numbers = … ;
List<Integer> integers = numbers.<Integer>mapMulti((number, consumer) -> {
    if (number instanceof Integer i)
        consumer.accept(i);
    })
    .collect(Collectors.toList());
Optional<T> reduce(BinaryOperator<T> accumulator)Performs a reduction on the elements and returns an Optional describing the reduced value. If there is no value, an empty Optional is returned.
T reduce(T identity, BinaryOperator<T> accumulator)Performs a reduction on the elements of this stream, using the provided identity value and an associative accumulation function, and returns the reduced value.
<U> U reduce(U identity, BiFunction<U,? super T,U> accumulator, BinaryOperator<U> combiner)Performs a reduction on the elements of this stream, using the provided identity, accumulation and combining functions.
The combiner is used to combine two partial reductions from two different threads; it must respect combiner.apply(u, accumulator.apply(identity, t)) == accumulator.apply(u, t).
stringStream.collect( Collectors.joining( "," ) )Create a comma-separated list from a stream of strings.
Stream<T> peek(Consumer<? super T> action)Return a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream.
JUnit