Removing unnecessary code

With Java 5 use boxing and unboxing are unnecessary because it is made automatically by JVM, it doesn't impact on performance, but get the code more clean.
Use of foreach is cleaner than use for with index, also just clean code.