Question: ```
public void setSpeciality(String spec) {
    if(specialities.stream().anyMatch(s-> s.equalsIgnoreCase(spec))) {
        speciality =spec;
    }
    else
    speciality = "General Practitioner";
}

```

I need to search an array list called specialities (case insensitive) ^ see my attempt at an answer^ but cant figure out what in my answer is wrong.

Answer: 
`anyMatch` only returns `true` or `false` indicating whether there is at least 1 element in the stream that satisfies the predicate.

You should use `filter` and `findFirst`, which returns the first element that matches the predicate:

```
speciality = specialities.stream()
                 .filter(spec::equalsIgnoreCase)
                 .findFirst()
                 .orElse("General Practitioner");

```
You are overriding speciality so every time you will be getting same result.

change code like below

```
    public void setSpeciality(String spec) {
       if(specialities.stream().anyMatch(s-> s.equalsIgnoreCase(spec))) {
            speciality =spec;
       }else{
           speciality = "General Practitioner";
       }
     }

```