static L flattenCollectionsAndArrays(Iterable a) { new L l; for (O x : a) if (x cast Cl) l.addAll(flattenCollectionsAndArrays(x)); else if (x cast O[]) l.addAll(flattenCollectionsAndArrays(asList(x))); else l.add(x); ret l; } static L flattenCollectionsAndArrays(O... whatever) { ret flattenCollectionsAndArrays(ll(whatever)); }