public List<ArrayList<String>> removeRow(int columnIndex,Set<String> masterData,List<ArrayList<String>> rowColumnData){
List<ArrayList<String>> finalData= new ArrayList<ArrayList<String>>();
for(ArrayList<String> data: rowColumnData){
String columnVal=data.get(columnIndex);
if(masterData.contains(columnVal){
finalData.add(data);
}
return finalData;
}
I need to filter out rows if a specific set of values of a column didn't match. My masterData contains 30,000 records. My rowColumnData will going to hold 2M records, basically a row whose column values are store in a array list and the entire table data is List>.
How can using stream API write the code which is going to give me better performance?