This would improve performance and code safety as it enforces static checking of what it is exactly serialized
See https://github.com/heathermiller/spores and start with https://github.com/juanrh/sscheck/blob/master/src/main/scala/es/ucm/fdi/sscheck/prop/tl/DStreamTLProperty.scala that is the most critical code. Use the provided implicits to ensure compatibility with Spark