Java Collection Concatenate concat(Collection a, Collection b)

Here you can find the source of concat(Collection a, Collection b)

Description

concat

License

Open Source License

Declaration

public static <T> Collection<T> concat(Collection<T> a, Collection<T> b) 

Method Source Code


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

import java.util.*;

public class Main {
    public static <T> Collection<T> concat(Collection<T> a, Collection<T> b) {
        Collection<T> result = new ArrayList<>(a.size() + b.size());
        result.addAll(a);//  w ww . j  av a2 s .  c o  m
        result.addAll(b);
        return Collections.unmodifiableCollection(result);
    }
}

Related

  1. concat(Collection collection, String delimiter)
  2. concat(Collection c)
  3. concat(Collection items)
  4. concat(Collection parts, int start, String defaultText)
  5. concat(Collection pieces, String delim)
  6. concat(Collection a, int offset, String sep, String start, String end)
  7. concat(Collection first, Collection second)
  8. concat(Collection... collections)
  9. concat(final Collection... collections)