Java Collection Contain containsAny(Collection firstCollection, Collection secondCollection)

Here you can find the source of containsAny(Collection firstCollection, Collection secondCollection)

Description

contains Any

License

BSD License

Declaration

public static <V> boolean containsAny(Collection<V> firstCollection, Collection<V> secondCollection) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

import java.util.Collection;

public class Main {
    public static <V> boolean containsAny(Collection<V> firstCollection, Collection<V> secondCollection) {

        for (V firstCollectionValue : firstCollection) {
            for (V secondCollectionValue : secondCollection) {
                if (firstCollectionValue != null && firstCollectionValue.equals(secondCollectionValue)) {
                    return true;
                }//ww  w  .  j  a  v a 2  s .c o m
            }
        }

        return false;
    }
}

Related

  1. containsAny(Collection strs, Collection searchTerms)
  2. containsAny(Collection collection, Collection query)
  3. containsAny(Collection collection, Collection toCheck)
  4. containsAny(Collection list, Collection values)
  5. containsAny(Collection src, Collection containsAny)
  6. containsAny(final Collection a, final Collection b)
  7. containsAny(final Collection coll1, final Collection coll2)
  8. containsAny(final Collection collection, final Object... items)
  9. containsAny(final Collection collection1, final Collection collection2)