Java Pitfalls - Nulls and NullPointerException

Pitfall - Making good unexpected nulls

Pitfall - Using null to represent an empty array or collection

Pitfall - Returning null instead of throwing an exception

Pitfall - Not checking if an IO stream isnt even initialized when closing it

Pitfall - Using Yoda notation to avoid NullPointerException

Pitfall - Unnecessary use of Primitive Wrappers can lead to NullPointerExceptions