In Java Boolean.TRUE method has following implementation
/**
* The {@code Boolean} object corresponding to the primitive
* value {@code true}.
*/
public static final Boolean TRUE = new Boolean(true);
and now:
System.out.println(new Boolean(true) == new Boolean(true));
System.out.println(Boolean.TRUE == Boolean.TRUE);
prints:
false
true
WHY ?!