It doesn't matter in this case but it's good practice to have CONSTANT.equals(variable) as you can be more sure that the constant won't be null and therefore not get NullPointerExceptions. Even when you know toolId isn't going to be null it's good practice so that when someone refactors the code they don't introduce the possibility of NPE from it.