Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java stream inner join two lists

List<Integer> s1 = Arrays.asList(1, 2);
List<Integer> s2 = Arrays.asList(1, 3);
 
s1.stream()
  .flatMap(v1 -> s2.stream()
                   .filter(v2 -> Objects.equals(v1, v2))
                   .map(v2 -> tuple(v1, v2)))
  .forEach(System.out::println);
Comment

PREVIOUS NEXT
Code Example
Java :: cookie jsf 
Java :: Java Create a BufferedInputStream 
Java :: java Math.sqrt(double) 
Java :: export java command in linux 
Java :: exceptions in java 
Java :: minecraft fabric client message 
Java :: java code for scientific calculator GUI 
Java :: string to char 
Java :: do function after time android studio 
Java :: does not have a NavController set on 2131231008 
Java :: what is use of drivermanager class 
Java :: java scanner int to string 
Java :: android check file extension 
Java :: how to merge two arrays in java 
Java :: array.swap java 
Java :: java array object 
Java :: math square java 
Java :: Unable to find bundled Java version mac m1 
Java :: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
Java :: difference between two sets java 
Java :: display 2d array 
Java :: how to sort the arraylist without changing the original arraylist 
Java :: maths.random in Java 
Java :: java split on { 
Java :: java assert 
Java :: string array to string stream java 
Java :: Java Remove ArrayList Elements 
Java :: uml to java 
Java :: creating an object in java 
Java :: nth fibonacci number java using for loop 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =