~ 1 min read

Subset Test in Java

A neat method to test for a set containment in another set both of which are Collections

private boolean isSubsetOf(Collection<String> subset, Collection<String> superset) {
    for (String string : subset) {
        if (!superset.contains(string)) {
            return false;
        }
    }
    return true;
}