code: private int compareView(ViewRef<?> viewA, 
                            ViewRef<?> viewB,
                            Class<?> type)
    {
      int cmp = viewB.priority() - viewA.priority();
      
      if (cmp != 0) {
        return cmp;
      }
      
      cmp = typeDepth(viewA.type(), type) - typeDepth(viewB.type(), type);
  
      if (cmp != 0) {
        return cmp;
      }
      
      // equivalent views are sorted by name to ensure consistency
      
      String nameA = viewA.resolver().getClass().getName();
      String nameB = viewB.resolver().getClass().getName();
      
      return nameA.compareTo(nameB); 
    }
docs: sort views.
  
  Higher @Priority is a better match.
  Closer type match is a better match.