how to get object from optional in java