If I have the following array:

```
[1,1,1,2,2,1,1,1,1,2,2,3]

```

Is there any built in method in Kotlin which will filter out adjacent elements of the same value, resulting in:

```
[1,2,1,2,3]

```

It's important that the order is preserved.

P.S. My actual use case isn't integers, it's an object which implements equals.