IntelliJ based cleanup: continued - requires JDK 1.5 and newer.

* use foreach wherever possible.
* use string.contains(..) instead of string.indexOf(..) == -1
IntelliJ-based cleanup: continued .. Forces JDK 1.5 or newer.

* Fixed == and != uses with equals()
* Removed redundant boxing/unboxing
* Removed redundant casts
Last bit of IntelliJ based clenaup for now

* Inverted boolean method.
* Removed unnecessary throws declarations.
* Removed unnecessary semicolon.