Adding to a list

I have a list of strings L1, and i want to add these strings to another list L2, adding two of each string where there is more than one of this string currently in the list L1. Does anybody know how i might be able to do this?Thanks
[246 byte] By [oraistea] at [2007-10-2 13:20:54]
# 1
How about ArrayList.addAll(...)?
tjacobs01a at 2007-7-13 10:56:25 > top of Java-index,Java Essentials,Java Programming...
# 2

If an string occurs more than two times in the first list i only want to add it to the second list two times. Sorry my description wasnt very clear, il explain it in more detail

I have two lists, one that contains a number of strings and one that is empty. I want to add one of every single string in the first list onto the second list, and where a string occurs more than one time in the first list i want to add it a second time onto the second list.

So that one of every string will be on the second list, and two of every string that appears more than one time on the first list will appear on the second list.

So if list 1 contains

[it, is, a, cold, morning, it, it, one, a]

then the second list would contain

[it, is, a, cold, morning, it, one, a]

the third 'it' will not be added

I have a method to add one of every element to the second list:

Iterator iterW = W.iterator();

while ( iterW.hasNext()){

Object e = iterW.next();

if(!check.contains(e)) {

check.add(e);

}

}

I dont know how to add all duplicates just one more time

oraistea at 2007-7-13 10:56:25 > top of Java-index,Java Essentials,Java Programming...