UML class diagram composition with class hierarchies
===

I was wondering if I can model the relationship between the two class hierarchies below, in the way that I did:

![car-engine composition relationship][1]

The code that would represent the meaning of this would be something like:

    public abstract class Car
    {
        protected Engine engine;  
    }
    public class StreetCar extends Car
    {
         public StreetCar()
         {
              engine = new StreetEngine();
         }
    }

...and similarly for the class OffroadCar, it would do something like `engine = new OffroadEngine()`. I have not included anything about the accelerate() method, it's not relevant. 

I just want to know if the composition is modeled correctly or if it redundant or even wrong to add that many composition arrows.


  [1]: http://i.stack.imgur.com/pkwYm.png