Java 8 agnostism for our test suite

Continuing on from @gkossakowski's work in #3404.