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 {
    /**
     * Checks whether the given source collection contains any of the items in the find {@link Collection}.
     * 
     * @param source
     * @param find
     * @return
     */
    public static <T> boolean containsAny(Collection<T> source, Collection<T> find) {
        for (T tofind : find) {
            if (source.contains(tofind)) {
                return true;
            }
        }
        return false;
    }
}