Use double and boolean when the argument must not be null. Then you do not need the check.