@Override
  public List<String> getInvalidRootUrls(OrderRootType type) {
    if (myDisposed) return Collections.emptyList();

    final List<VirtualFilePointer> pointers = myRoots.get(type).getList();
    List<String> invalidPaths = null;
    for (VirtualFilePointer pointer : pointers) {
      if (!pointer.isValid()) {
        if (invalidPaths == null) {
          invalidPaths = new SmartList<String>();
        }
        invalidPaths.add(pointer.getUrl());
      }
    }
    return invalidPaths == null ? Collections.<String>emptyList() : invalidPaths;
  }
 // TODO<rv> Remove the next two methods as a temporary solution. Sort in OrderRootType.
 //
 public static List<OrderRootType> sortRootTypes(Collection<OrderRootType> rootTypes) {
   List<OrderRootType> allTypes = new ArrayList<OrderRootType>(rootTypes);
   Collections.sort(
       allTypes,
       new Comparator<OrderRootType>() {
         @Override
         public int compare(final OrderRootType o1, final OrderRootType o2) {
           return getSortKey(o1).compareTo(getSortKey(o2));
         }
       });
   return allTypes;
 }