SPARK-4297 [BUILD] Build warning fixes omnibus

There are a number of warnings generated in a normal, successful build right now. They're mostly Java unchecked cast warnings, which can be suppressed. But there's a grab bag of other Scala language warnings and so on that can all be easily fixed. The forthcoming PR fixes about 90% of the build warnings I see now.
The generic types are wrong, but the underlying objects are fine. `JavaTestUtils.runStreams` returns a `List<List<V>>` so happily binds the `Tuple2` type to whatever the caller says. The reason the comparison compiled was that `assertEquals(Object, Object)` accepts anything. The ultimate `List.equals()` method doesn't care about types and compares values which are in fact correct and of the right type and equal.