Java 8: Extracting a pair of arrays out of a Stream<Pair>
问题 So I have some code using Java 8 streams, and it works. It does exactly what I need it to do, and it's legible (a rarity for functional programming). Towards the end of a subroutine, the code runs over a List of a custom pair type: // All names Hungarian-Notation-ized for SO reading class AFooAndABarWalkIntoABar { public int foo_int; public BarClass bar_object; .... } List<AFooAndABarWalkIntoABar> results = ....; The data here must be passed into other parts of the program as arrays, so they