Integer i=i1 or Integer i=Integer.valueOf(i1); these will not create a new object.It still refer to same reference.
that's why you are getting true . == operator checks for references matching.
equals checks for value matching .
How did you run the program?? Which version of JDK are you using?? On my JDK 1.6 build 11 its generating true output for your program (which BTW also has an unused import )...