The form:
Boolean b = Boolean.valueOf(true);
Is slightly more efficient than the subjectively uglier:
Boolean b = new Boolean(true);
So couple of notes on that. The "new" operator is cheap, but still involves an allocation. Oddly enough, one of the strangest bugs I found back in the day was: Boolean a = new Boolean(true);
Boolean b = new Boolean(true);
System.out.println(a == b);
false
But with objects and wrapper types, the .equals() method is the correct way to compare two objects.