Or use the null object pattern. Then you can write code that "just works"; kind of a higher level version of a nop.
Java's Optional is a bad idea implemented badly made even more bad by bad usage.
Option(null).map(str => str + "!").foreach(str => println(str)) is a noop.
"...an object which implements the expected interface, but whose method body is empty. "