Java examples for Collection Framework:HashSet
set Intersection between HashSet
//package com.java2s; import java.util.HashSet; public class Main { public static <T> boolean setIntersection(HashSet<T> set1, HashSet<T> set2) { for (T elem : set1) if (set2.contains(elem)) return true; return false; }//from w w w . jav a 2s. c o m }