@NotNull
  @Override
  public Set<UsageDescriptor> getProjectUsages(@Nullable Project project) {
    if (project == null) return Collections.emptySet();

    final Set<LibraryKind> usedKinds = new HashSet<LibraryKind>();
    final Processor<Library> processor =
        new Processor<Library>() {
          @Override
          public boolean process(Library library) {
            usedKinds.addAll(LibraryPresentationManagerImpl.getLibraryKinds(library, null));
            return true;
          }
        };
    for (Module module : ModuleManager.getInstance(project).getModules()) {
      ModuleRootManager.getInstance(module)
          .orderEntries()
          .librariesOnly()
          .forEachLibrary(processor);
    }

    final HashSet<UsageDescriptor> usageDescriptors = new HashSet<UsageDescriptor>();
    for (LibraryKind kind : usedKinds) {
      usageDescriptors.add(new UsageDescriptor(kind.getKindId(), 1));
    }
    return usageDescriptors;
  }