java 8 get list of objects from optional and get value code example
Example: instantiate optinal java 8
Person p = new Person();
Optional<Person> op = Optional.of(p);
Person p = new Person();
Optional<Person> op = Optional.of(p);