Java 6-8 agnosticism for a test

Under Java 8, the output contains newly added methods in
j.u.Iterator.

I've created cut down, test-local versions of the relevant types
to decouple.
Support Java 8 in the checkfile for neg/t6289
Merge pull request #3815 from retronym/topic/java8-support-2

Java 8 agnostism for our test suite