There are two ways you can do this.
1.) By directly asserting the object is null.
e.g.
String str = null;
Assert.assertTrue(str == null, "String str is not null");
Or you can try using try catch block to catch NPE and assert it or log it.
try{
str.toLowerCase();
}catch(NullPointerException nullPointerException){
System.out.print("Null pointer exception");
//you can do your assertion here
}
Hope that helps!