Correct the Java 8 streams sequential code.