There are many ways that this can be implemented that avoid an if result != null / == no value, often a map suffices.
There are many ways that this can be implemented that avoid an if result != null / == no value, often a map suffices.