In my opinion, null checks are evil. They show that there is no contract that establishes whether it can objbe nullor not. A good alternative would be to write code in a way that is objnever guaranteed null. For example: if getter should not receive null obj, but cannot, he must throw an exception.
source
share