I have a list like this:

```
val l= List(("Agent", "PASS"), ("Agent", "FAIL"), ("Agent 1", "FAIL"), ("Agent", "PASS"), ("Agent 2", "PASS") )

```

and I need to end up with a list like this:

```
val filteredList= List(("Agent", "FAIL"), ("Agent 1", "FAIL"), ("Agent 2", "PASS") )

```

What happened? 

```
("Agent", "PASS"), ("Agent", "FAIL")

```

becomes

```
("Agent", "FAIL")

```

(because if there is at least one FAIL, I need to keep that entry)

the entries for Agent 1 and Agent 2 stay the same because there are just one entry for each.

The closest answer I found is
[How in Scala to find unique items in List](https://stackoverflow.com/questions/1538598/how-in-scala-to-find-unique-items-in-list) but I cannot tell how to keep the entries with FAIL.

I hope the question is clear, if not, I can give you a better example.

Thanks