@Nullable
 public GradleLibraryDependency findLibraryDependency(
     @NotNull final GradleLibraryDependencyId id) {
   final GradleModule module = findGradleModuleByName(id.getModuleName());
   if (module == null) {
     return null;
   }
   final Ref<GradleLibraryDependency> ref = new Ref<GradleLibraryDependency>();
   GradleEntityVisitor visitor =
       new GradleEntityVisitorAdapter() {
         @Override
         public void visit(@NotNull GradleLibraryDependency dependency) {
           if (id.getLibraryName().equals(dependency.getName())) {
             ref.set(dependency);
           }
         }
       };
   for (GradleDependency dependency : module.getDependencies()) {
     dependency.invite(visitor);
     final GradleLibraryDependency result = ref.get();
     if (result != null) {
       return result;
     }
   }
   return null;
 }
  /**
   * Allows to answer if target library dependency is still available at the target project.
   *
   * @param id target library id
   * @return <code>true</code> if target library dependency is still available at the target
   *     project; <code>false</code> otherwise
   */
  public boolean isIntellijLibraryDependencyExist(@NotNull final GradleLibraryDependencyId id) {
    final Module module = findIntellijModuleByName(id.getModuleName());
    if (module == null) {
      return false;
    }

    RootPolicy<Boolean> visitor =
        new RootPolicy<Boolean>() {
          @Override
          public Boolean visitLibraryOrderEntry(
              LibraryOrderEntry libraryOrderEntry, Boolean value) {
            return id.getLibraryName().equals(libraryOrderEntry.getLibraryName());
          }
        };
    for (OrderEntry entry : myFacade.getOrderEntries(module)) {
      if (entry.accept(visitor, false)) {
        return true;
      }
    }
    return false;
  }