Reading material

Pages 108-109 (part of Section 3.4.3), pages 194-205 (Section 5.2)

Additional material

Implementation of a list by means of a double linked list in pseudocode: PostScript and PDF

Position
InspectablePositionalContainer
PositionalContainer
InspectableList
EmptyContainerException
List
DNode
NodeList

Question

Given a List whose elements are one of the following objects
  public static final Object RED = new Object();
  public static final Object WHITE = new Object();
  public static final Object BLUE = new Object();
The list may contain each object more than once. Write a method
  public static void sort(List list)
that sorts the elements: first all the red, then the white and finally the blue objects.