Java Collection Merge merge(Collection dest, Collection src)

Here you can find the source of merge(Collection dest, Collection src)

Description

Method merge

License

Open Source License

Parameter

Parameter Description
dest Collection
src Collection

Return

Collection

Declaration

public static Collection merge(Collection dest, Collection src) 

Method Source Code


//package com.java2s;

import java.util.Collection;

public class Main {
    /**/*  w  w  w  .j  a  v  a 2 s.c o  m*/
     * Method merge
     * @param dest Collection
     * @param src Collection
     * @return Collection
     */
    public static Collection merge(Collection dest, Collection src) {
        if (src == null) {
            return dest;
        }

        if (dest == null) {
            return src;
        }

        dest.addAll(src);

        return dest;
    }
}

Related

  1. getMergedString(Collection values, String delimiter)
  2. merge(CC target, Collection a, Collection b)
  3. merge(Collection splits)
  4. merge(Collection strings, char separator)
  5. merge(Collection... collections)
  6. merge(Collection... collections)