Suppress unchecked cast warnings in CollectionUtil

[skip ci].