Comment From: ZhangShenao

HashSet.toArray() will use the actual size of HashSet, so it's unnecessary to pass a large size array. @jasonab

Comment From: harawata

Thank you, @ZhangShenao !