I have a list of type List in functional java using List type provided by fj.data.List
import fj.data.List
List<Long> managedCustomers
I am trying to filter it using the following:
managedCustomers.filter(customerId -> customerId == 5424164219L)
I get this message
According to documentation, List has a filter method and this should work http://www.functionaljava.org/examples-java8.html
What am I missing?
Thanks
As already pointed out in the comment by @Alexis C
should get you the filtered list if the
customerId
equals5424164219L
.Edit - The above code modifies the existing
managedCustomers
removing the other entries. And also the other way to do so is using thestream().filter()
as -Edit 2 -
For the specific
fj.List
, you can use -