Ad
  • Custom User Avatar

    I honestly can't tell if that's sarcastic, but I hope it is. I used streaming to keep my streaming knowledge fresh, not because it's remotely a good idea for this problem (you'll notice there's 0 Best Practices votes, not even one from me). Mapping each individual value into its own stream is particularly painful.

    And I bet the performance sucks, particularly because of .mapToObj(IntStream::of).

    The real Java solution for this is a simple for loop with iterations equal to the length of the longer array.