The traditional options are Java are:<p>1. Assume parameters aren&#x27;t null, and then everything breaks and you fix it.<p>2. Assume ANY object can be null, and check them all, in every single method, and create correct handling in each case. Basically no one does this.<p>3. Try to figure out which things can be null or not depending on context. Sometimes you are still wrong, and get NPEs. This is what people actually do.<p>By defensive programming, do you mean #2? Because that kinda sucks compared to just using Optionals.