Comment
LaurentChicoine
Tera Guru

Have you tried simply pushing values without using arrayUtil.contains() and at the end using arrayUtil.unique() to get an array of unique values? That is usually how I'm doing it when I need unique values. I don't think it will be as fast as your key value object but it should be close.