The list of methods to do Assert Not Null are organized into topic(s).
Object
assertFormatResultNotNull(Object r) assert Format Result Not Null
if (r != null) {
return r;
throw new NullPointerException("TemplateValueFormatter result can't be null");
void
assertInstanceOfNotNull(Object obj, Class> expClass) Checks if the passed object is of the class specified, null values throw an exception
if (obj == null) {
throw new AssertionError(
"Checking instanceof but object is null, expecting class: " + expClass.getName());
if (!(expClass.isAssignableFrom(obj.getClass()))) {
throw new AssertionError(
"Expected class: " + expClass.getName() + " but object has class: " + obj.getClass().getName());