Sync Java 6/7 and Java 8 versions

I ran a diff between the two branches. There were a number of small changes between the two, especially in the tests, as well as a missed file. I've changed a few things to minimize the diff where possible, leaving only actual functional changes.
I'm familiar with it, but I didn't think the automatic type inference worth the extra diff.