I have a couple of questions actually.
I have a class Dog with the following instance fields:
private int id; private int id_mother;
I solved this using java 8 lambdas
int dogId = 2; return dogList.stream().filter(dog-> dogId == dog.getId()).collect(Collectors.toList()).get(0);