I have list of tasks about 700 task or more i am trying to search by taskId using below code. it works but it takes a lot of time about 1 minute. list is not sorted
List<Tasks> tasks = ....;
tasks = tasks
.stream()
.filter(task -> task.getTaskId().equals("1000"))
.collect(Collectors.toList());
looping tasks take the same time almost
How to enhance my code?
Regards