I think it's safer to compare with using the matches() method than to compare with using the literal. So I changed it like this.

Comment From: rstoyanchev

Thanks for the PR but none of the changed places are exposed to NullPointerException and the current checks are fine, even a little shorter, so we'll keep them as they are.