Use nullable optional instead of checking it.
Allow to use code with Java 6.