Here you can find the source of intersection(Collection
Parameter | Description |
---|---|
a | first collection |
b | second collection |
Parameter | Description |
---|---|
IllegalArgumentException | if any of arguments is null |
public static <T> Collection<T> intersection(Collection<T> a, Collection<T> b) throws IllegalArgumentException
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { /**/*from w ww. j ava 2 s .c om*/ * Intersection of two collections with duplicates * * @param a first collection * @param b second collection * @return new Collection with elements from a and b intersection, can have duplicates * @throws IllegalArgumentException if any of arguments is null */ public static <T> Collection<T> intersection(Collection<T> a, Collection<T> b) throws IllegalArgumentException { return null; } }