URL[] (@NotNull Collection<? extends File> libraries) { List<File> files = collectFiles(libraries); URL[] result = new URL[files.size()]; for (int i = 0; i < files.size(); i++) { try { result[i] = files.get(i).toURI().toURL(); } catch (MalformedURLException e) { LOG.error(e); // should never happen } } return result; }