[SPARK-4364][Streaming] Fix the variable types

Because of the type erase, the unit tests will pass. However, the wrong variable types will confuse people.