Remove some unnecessary casts.
Minor improvements.
Add missing type params.
Simplify some expressions.
Run these tests on the IBM JDK again in the hope that the upgrade to Groovy 2.3.6 fixed the problem.

+review REVIEW-5034