Java List Concatenate concat(List list1, List list2)

Here you can find the source of concat(List list1, List list2)

Description

concat

License

Open Source License

Declaration

public static <T> List<T> concat(List<? extends T> list1, List<? extends T> list2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static <T> List<T> concat(List<? extends T> list1, List<? extends T> list2) {
        if (list1 == null && list2 == null) {
            return null;
        }// www . j a  va 2 s.  co  m
        final List<T> result = new ArrayList<>();
        if (list1 != null)
            result.addAll(list1);
        if (list2 != null)
            result.addAll(list2);
        return result;
    }
}

Related

  1. concat(final byte[] result, final List buffers)
  2. concat(final Collection... lists)
  3. concat(final List list1, final List list2)
  4. concat(List list)
  5. concat(List l1, List l2)
  6. concat(List list, String delim)
  7. concat(List lista, List listb)
  8. concat(List items, String quotation, String separation)
  9. concat(List items, String separator)