SyntaxFix
Write A Post
Hire A Developer
Questions
I solved this using java 8 lambdas
int dogId = 2; return dogList.stream().filter(dog-> dogId == dog.getId()).collect(Collectors.toList()).get(0);