Java Collection Contain containsAny(final Collection collection1, final Collection collection2)

Here you can find the source of containsAny(final Collection collection1, final Collection collection2)

Description

contains Any

License

Apache License

Declaration

static boolean containsAny(final Collection<?> collection1, final Collection<?> collection2) 

Method Source Code


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

import java.util.Collection;

public class Main {
    static boolean containsAny(final Collection<?> collection1, final Collection<?> collection2) {
        for (final Object value : collection1) {
            if (collection2.contains(value)) {
                return true;
            }//from w  ww .  j a  v  a  2 s  . c o  m
        }
        return false;
    }
}

Related

  1. containsAny(Collection src, Collection containsAny)
  2. containsAny(Collection firstCollection, Collection secondCollection)
  3. containsAny(final Collection a, final Collection b)
  4. containsAny(final Collection coll1, final Collection coll2)
  5. containsAny(final Collection collection, final Object... items)
  6. containsAny(final Collection a, final Collection b)
  7. containsAnyIgnoreCase(String string, Collection searchStrings)
  8. containsAnyNull(Collection source)
  9. containsAnyOf(String s, Collection values)