clazz.getDeclaringClass may also throw NullPointerException