I want to concatenate multiple lists with a single command, e.g. to do something like:
myFirstList.concat(mySecondList).concat(myThirdList);
or maybe
List.concat(myFirstList, mySecondList,myThirdList);
i.e. I'd like something like
List<T> concat(List<T> additional);
as a member of List
(can't have that, I guess... :-( ), or
static <T> List<T> concat(List<T>... lists);
which is more doable. Does any package have this?
Note:
Yes, I know I can use addAll()
, but that returns a boolean, so you can't use it repeatedly in the same command.