Skip to content
Advertisement

Java Filter one stream based on another stream and collect

I have this code working with a for loop and steam, but I was wondering I can improve it using two streams. Here I want to replace the for loop with a stream and would like to get a list of String that the method returns.

JavaScript

Advertisement

Answer

I was able to find a quick and dirty solution, of course not the best, but sure I can improve this.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement