Introduction
We use assertNull to check if something is empty or missing. We use assertNotNull to check if something exists or is present.
When you want to make sure a method returns nothing (null) after some action.
When you want to confirm that an object or value is created and not empty.
When testing if a database query returns no result (null) or some data (not null).
When checking if a user input was not provided (null) or was given (not null).
When verifying that a service response is present or missing.