added a comment - - edited
I wouldn't expect any different btw ([1, 2, 3] as Integer).flatten() and ([1, 2, 3] as Object).flatten(), just as there is no difference btw ([[1, 2, 3] as Integer]).flatten() and ([[1, 2, 3] as Object]).flatten().
So yes, the result is a List, which is what createSimilarOrDefaultCollection creates.
And flatten as it is currently implemented is flattening multidimensional arrays (as my sample showed), so I don't understand what you're saying there.
Hmmm, I suppose this createSimilar jazz for arrays could be extended to consider element type for generics, but that goes beyond this issue (and there is Collection.flatten(Collection) which could be used).