List<DownloadableLibraryFileDescription> (FrameworkLibraryVersion version) { List<DownloadableLibraryFileDescription> selected = new ArrayList<>(); List<? extends DownloadableLibraryFileDescription> downloads = version.getFiles(); for (int i = 0; i < downloads.size(); i++) { if (myFilesList.isItemSelected(i)) { selected.add(downloads.get(i)); } } return selected; }