I had an interesting conversation with one of my team mate.
Is CONSTANT.equals(VARIABLE) faster than VARIABLE.equals(CONSTANT)in Java?
CONSTANT.equals(VARIABLE)
VARIABLE.equals(CONSTANT)
For me its not a speed issue, its a relability issue.
e.g.
"Hello".equals(a); // will never throw a NPE a.equals("Hello"); // can throw an NPE.
You may prefer it to blow up when a is null but usually I don't.
null