Please suggest some elegant way to convert
arrays of arrays to collections of collections and vice versa in Java.
I suppose there's no convenience methods in the Java API, right?
public static <T> T[][] nestedCollectionsToNestedArrays(
Collection<? extends Collection<T>> source){
// ... ?
}
public static <T> Collection<Collection<T>> nestedArraysToNestedCollections(
T[][] source){
// ... ?
}
Additional question:
What's with nested arrays of primitive types?
Do I have to declare methods for each primitive type, because of forbidden generic array creation?