Java List Value Add appendToList(List list, T[] elements)

Here you can find the source of appendToList(List list, T[] elements)

Description

append To List

License

Open Source License

Declaration

private static <T> List<T> appendToList(List<T> list, T[] elements) 

Method Source Code


//package com.java2s;
import java.util.ArrayList;
import java.util.Arrays;

import java.util.List;

public class Main {
    private static <T> List<T> appendToList(List<T> list, T[] elements) {
        List<T> result = new ArrayList<T>(list.size() + elements.length);

        result.addAll(list);/*  w  ww.  j  av  a  2s .c o  m*/
        result.addAll(Arrays.asList(elements));

        return result;
    }
}

Related

  1. addElementIfAbsent(List l, T element)
  2. addElements(boolean removeDuplicates, final List result, Collection elements)
  3. addElements(List list, T[] array)
  4. addElementsIfAbsent(List destList, Collection aColl)
  5. appendToList(List list, A elem)