Suppose we have a Collection. What is the best (shortest in LoC in current context) way to transform it to Foo[]? Any well-known
Collection
Foo[]
Alternative solution to the updated question using Java 8:
Bar[] result = foos.stream() .map(x -> new Bar(x)) .toArray(size -> new Bar[size]);