Make test Java 6 compatible.

5 jobs for master
Status Job ID Name Coverage
  Build
canceled #8252
jars-j8

canceled #8251
java8

 
  Test
canceled #8254
allowed to fail
java10

canceled #8255
allowed to fail
java11

canceled #8253
java7