Java tutorial
//package com.java2s; import java.util.Collection; public class Main { public static <K> boolean isIntersectingWith(Collection<K> a, Collection<K> b) { for (K v : a) { if (b.contains(v)) return true; } return false; } }