title: avoiding diamond in multiple inheritance
body: <p>i have to implement data structures that support abstract Numbers</p>
  
  <p>Collection is a collection of numbers</p>
  
  <p>sorted is a sorted collection</p>
  
  <p>list is a list collection of numbers (include duplicates)</p>
  
  <p>set is a collection of numbers without dup.</p>
  
  <p>Linked and Array are the format of the saved data (linked meaning diffuse in the heap and array meaning a contious amount of memory)</p>
  
  <p>then there are combinations of classes (a list that is array called arraylist and etc. in the picture)</p>
  
  <p>a simple uml:</p>
  
  <p><img src="https://i.stack.imgur.com/be2Yk.png" alt="uml3;"></p>
  
  <p>each of the last four combinatios (last row in the pic) need to implement a method call sorted that make a sorted copy of their own (return Sorted type).  i thought to make 4 new classes that are inheritance from sorted and the classes in the last row (for ex. an ArrayListSorted class that inheritance from Sorted class and ArrayList class) but then i have the diamond problem (in the same ex. Sorted and ArrayList are both Collection offspring)</p>
  
  <p>any better idea for disign?</p>