The list of methods to do Assert Null are organized into topic(s).
void
assertInstance(final Object object, final Class c, final boolean allowNull) Asserts the the given object is an instance of the given class -- optionally allowing the object to be
null.
if (object == null && allowNull) {
return;
if (object == null || c == null) {
throw new NullPointerException();
} else if (!c.isInstance(object)) {
throw new IllegalArgumentException();
void
assertIsNull(Object obj) Asserts that the passed entry is null
if (obj != null) {
throw new AssertionError(
"Passed object: " + obj.getClass().getName() + " is not null while this was expected");