Avoid null pointer exception is a primary concern. This static function should be used to validate every object before usage.