I think most of the packages will have only a single version installed, so you should use a default length of one:

```kotlin
map.getOrPut(pkg) { ArrayList<String>(1) }.add(ver)
```
```