There are two ways you can do this.
1.) By directly asserting the object is null.
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.
System.out.print("Null pointer exception");
//you can do your assertion here
Hope that helps!