code: public int compare(Object o1, Object o2) {
  		List list1 = (List) o1;
  		List list2 = (List) o2;
  
  		for (int i = 0; i < list1.size(); i++) {
  			if (list2.size() > i) {
  				Comparable component1 = (Comparable) list1.get(i);
  				Comparable component2 = (Comparable) list2.get(i);
  				int componentsCompared = component1.compareTo(component2);
  				if (componentsCompared != 0) {
  					return componentsCompared;
  				}
  			}
  			else {
  				// First instance has more components, so that instance is
  				// greater.
  				return 1;
  			}
  		}
  
  		// All components so far are equal - if the other instance has
  		// more components it is greater otherwise they are equal.
  		if (list2.size() > list1.size()) {
  			return -1;
  		}
  		else {
  			return 0;
  		}
  	}
docs: Compare two lists of Comparable objects.
  
  @param o1 the first object to be compared.
  @param o2 the second object to be compared.
  @throws ClassCastException if any of the lists contains an object that
  is not Comparable.