I believe the catch here is the valueOf(). When two wrappers are compared with ==, the references only are compared. b1 == b2 will be false when b1 = new Boolean(true) & b2 = new Boolean(true). But since valueOf() is used here, it gives the same object to both b1 & b2.
All the Boolean objects (unless created with new operator)are same if there boolean value are same.So here all the references b1,b2,b3,b4 will retrun true when checked with == amongst themselfs. The same is true for Character(ascii from 0 to 127),Interger(-128 to 127)),Short,Byte.