Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Iterator; public class Main { @SuppressWarnings("rawtypes") public static boolean allNotIn(Collection source, Collection target) { if (target == null || target.size() == 0) { return true; } for (Iterator it = source.iterator(); it.hasNext();) { Object candidate = it.next(); if (target.contains(candidate)) { return false; } } return true; } }