Java List Merge merge(List list, List items)

Here you can find the source of merge(List list, List items)

Description

merge

License

Apache License

Declaration

protected static <T> List<T> merge(List<T> list, List<T> items) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    protected static <T> List<T> merge(List<T> list, List<T> items) {
        if (list != null) {
            if (items != null) {
                for (T item : items) {
                    if (!list.contains(item)) {
                        list.add(item);/*from   w w w  .  java2  s .c o  m*/
                    }
                }
            }
        } else {
            return items;
        }
        return list;
    }
}

Related

  1. merge(List text)
  2. merge(List a, List b)
  3. merge(List a, List b, Comparator comp)
  4. merge(List list)
  5. merge(List list, int split)
  6. merge(String[] list)
  7. merge2ListsWithoutDup(List list1, List list2)
  8. mergeBandY(List A, int z, int y, int yn)
  9. mergeBytes(List packages)