Take this for example (excerpt from Java regex checker not working):
while(!checker) { matcher = pattern.matcher(number); if(matcher.find())
Try this:
if (Boolean.TRUE.equals(yourValue)) { ... }
As additional benefit this is null-safe.