private Set<String> getDuplicates(Set<GradleLibrary> libraries) {
   Set<String> duplicates = new HashSet<String>();
   Set<String> seen = new HashSet<String>();
   for (GradleLibrary library : libraries) {
     if (library.getFile() != null && !seen.add(library.getFile().getName())) {
       duplicates.add(library.getFile().getName());
     }
   }
   return duplicates;
 }
 private Set<GradleLibrary> minus(Set<GradleLibrary> source, Set<GradleLibrary> toRemove) {
   if (source == null || toRemove == null) {
     return source;
   }
   Set<File> filesToRemove = new HashSet<File>();
   for (GradleLibrary library : toRemove) {
     filesToRemove.add(library.getFile());
   }
   Set<GradleLibrary> result = new LinkedHashSet<GradleLibrary>();
   for (GradleLibrary library : source) {
     if (!filesToRemove.contains(library.getFile())) {
       result.add(library);
     }
   }
   return result;
 }