FileReferenceFactory fileReferenceFactory = new FileReferenceFactory(); return files.stream().filter(f -> f.getName().endsWith(".jar")).map(f -> { Library library = new Library(fileReferenceFactory.fromFile(f)); library.setSourcePath(aarLibrary.getSourcePath()); return library;