Java Utililty Methods List Merge

List of utility methods to do List Merge

Description

The list of methods to do List Merge are organized into topic(s).

Method

intmergeIntegerResult(List result)
merge Integer Result
int total = 0;
for (int it : result) {
    total += it;
return total;
SetmergeList(List sourceList, List resultList, Set filterSet)
merge List
if (sourceList == null) {
    return filterSet;
for (Object ratinigAID : sourceList) {
    if (filterSet.contains(ratinigAID)) {
    } else {
        resultList.add(ratinigAID);
        filterSet.add(ratinigAID);
...
ListmergeList(List list1, List list2, List... rest)
merge List
int size = list1.size() + list2.size();
for (List<? extends T> l : rest) {
    size += l.size();
List<T> result = new ArrayList<>(size);
result.addAll(list1);
result.addAll(list2);
for (List<? extends T> l : rest) {
...
ListmergeList(List list1, List list2)
merge List
list1.addAll(list2);
Collections.sort(list1);
return list1;
ObjectmergeList(List list)
merge List
Object ret = null;
for (Object value : list) {
    ret = add(ret, value);
return ret;
ObjectmergeList(List list)
merge List
Object ret = null;
for (Object value : list) {
    ret = add(ret, value);
return ret;
ListmergeList(List list1, List list2)
merge List
List<String> list = new ArrayList<String>(Arrays.asList(new String[list1.size()]));
Collections.copy(list, list1);
list.addAll(list2);
return list;
ListmergeList(List list, List... others)
merge List
List<T> result = list == null ? new ArrayList<>() : new ArrayList<>(list);
for (List<T> other : others)
    result.addAll(other);
return result;
ListmergeListNoDuplicate(List one, List two)
merge List No Duplicate
if (isAllNull(one, two))
    return null;
List<T> result = new ArrayList<>();
if (isAllNotNull(one, two)) {
    result.addAll(one);
    for (T t : two) {
        if (one.indexOf(t) == -1) {
            result.add(t);
...
ArrayListmergeLists(final T... array)
Merge arrays
final ArrayList<T> retValue = new ArrayList<T>();
Collections.addAll(retValue, array);
return retValue;