I've this code:
List<Application> applications = this.applicationDao.findAll();
Collection<Pair<Application, FileObject>> files = applications.stream()
.flatMap(app -> streamOfFiles.map(file -> Pair.of(app, file)));
where streamOfFiles
is an Stream<FileObject>
Currently, I'm getting this compilation message:
Type mismatch: cannot convert from
Stream<Object>
toCollection<Pair<Application,FileObject>>
Any ideas?