TrackItemStreamTransformer in Scala