LibraryDescriptor (LibraryDescriptor library, String newLibraryName, final Collection<? extends File> jarsToExtract) { final LibraryDescriptor newLibrary = new LibraryDescriptor(newLibraryName, new ArrayList<>(jarsToExtract)); myLibraries.add(newLibrary); library.removeJars(jarsToExtract); if (library.getJars().size() == 0) { removeLibrary(library); } return newLibrary; }