Java level migration aids

- foreach instead of having to pass through all the items of a collection
- remove unnecessary boxing and unboxing
- StringBuilder instead of StringBuffer