Adding generics to Trajectory