Nested forEach in Java 8
问题 I want to rewrite this piece of code in terms of streams from Java 8 for (Medium medium : sortierteMedien) { System.out.println("Fuenf aehnlichste Medien fuer " + medium.getClass() + " mit dem Titel " + medium.getTitel() + ":\n"); for (Medium medium1 : bibliothek.medienSim(medium)) { System.out.println(medium1.toString()); } System.out.println(); } The difficulty here is, that there is a print statement before and after each inner for loop. Is it possible to rewrite this with streams? 回答1: