[SPARK-4459] added keyBy test
[SPARK-4459] changed type parameter for keyBy from K to U