[BUILD] Fix generics issue that breaks compilation under Java 6.