I have worked with Python for many years, but now I am workig with Java and having a little of experience with inovations in the direction of functional programming brought by Java 8. In a scenario where I have two Strings wich both can be null, I want to…