If you're using JDK 5 or later, then this:
can also be written like this:
However both these bits of code share another problem with your original code above - they all throw a NullPointerException if authorized is null. (And so far, there's been no code shown
setting it to anything, so yes, it's probably null.) So when using a Boolean like this, you generally need to either (a)
test the reference before you use it, to see if it's null, or (b) write your code in a way that ensures the variable has been set non-null before you use it. However, both of these are somewhat error prone, as people can forget to check or ensure when they modify the code. Consequently I usually prefer to use a boolean primitive rather than a Boolean object - that way there's no possibility of null. Usually that's a good thing, I think.