Further Java 7 migration

Update remaining Collections to use the diamond operator (<>)
 for main package

Replace for loops with foreach where applicable

Use a switch to test one string against many.

Change-Id: I1861f0fd0c718e8f9859b0e33a761f5e9f8e8001