In function getNestedFieldValAsString, we call getNestedFieldVal function to get the value. Then we check if the object returned is null, which is always false, since the called function throws an exception rather than returning null.
Need to change the code accordingly.
Test classes -
- We have defined checked exceptions at a lot of places which are actually not thrown anywhere.
- Similarly, java stream code can be refactored at a lot of places.