Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Collection;

public class Main {

    public static <E> void intersection(final Collection<E> a, final Collection<E> b) {
        if (b != null && !b.isEmpty()) {
            if (a.isEmpty()) {
                a.addAll(b);
            } else {
                a.retainAll(b);
            }
        }
    }
}