=str #15892 Fix ClassCastException in ThunkSource

* and add test
Merge pull request #15994 from akka/wip-15892-ClassCastException-ThunkSource-patriknw

=str #15892 Fix ClassCastException in ThunkSource