We often write code, where we check if an object is a null or not. Based on that we take actions. These action(s) are often part of the API.
But, we can use functional programming to pass the power to the user.
Where the user/caller can decide what to do in these cases.
Website : refactoredcodes.com
#java #functionalprogramming #functioncomposition #nullcase