Suppose that I have two int[] arrays input1 and input2. I want to take only positive numbers from the first one, take distinct numbers from the second one, merge them together, sort and store into the resulting array. This can be performed using streams: int[] result = IntStream.concat(Arrays.stream(input1).filter(x -> x > 0), Arrays.stream(input2).distinct()).sorted().toArray(); I want to speed u