The easiest way to transform collection to array? November 30, 2022 by Tarik Where x is the collection: Foo[] foos = x.toArray(new Foo[x.size()]);