I prefer
```
if (null == test) {
    return;
}

SmsManager sms=SmsManager.getDefault();
...