Fix a jdk version based generics bug in tests.