PLT-497 Better handling of null

Fix Javadoc
Use Optional