List<Left> resultList = lists.iterator().next();
for (Iterator iterator = lists.iterator(); iterator.hasNext();) {
List<Left> list = (List<Left>) iterator.next();
resultList.retainAll(list);
}
/*for (Left left : resultList) {
System.out.println(left.getData());
}*/
for (Left left : mLeft) {
ArrayList<Left> mTempList = left.getArray();
for (Iterator iterator = mTempList.iterator(); iterator.hasNext();) {
Left left2 = (Left) iterator.next();
System.out.println(left2.getData());
}
}
I am trying to find out the common elements , my original list is getting changed.I mean only last element gets changed when I print the lists. Any suggestions.