As a demonstration of Optional, we are going to create an in-memory student repository. This repository has a method to find students by their name, which, for convenience, will be considered the ID. The value returned by the method is Optional<Student>; this means that the response might or might not contain a Student. This pattern is basically one of the common scenarios for Optional.
First of all, we need a Student class to represent ...