Check out example codes for "java 8 stream option". It will help you in understanding the concepts better.

Code Example 1

things.stream()
    .map(this::resolve)
    .filter(Optional::isPresent)
    .map(Optional::get)
    .findFirst();

Learn ReactJs, React Native from akashmittal.com