is one Collection<String> Subset String Of another Collection<String> - Android java.lang

Android examples for java.lang:array

Description

is one Collection<String> Subset String Of another Collection<String>

Demo Code

import java.util.Collection;

public class Main{

    public static boolean isSubsetStringOf(Collection<String> subset,
            Collection<String> superset) {
        if (subset != null && superset != null) {
            for (String string : subset) {
                if (!superset.contains(string)) {
                    return false;
                }//from  w  w  w  . j a v  a 2 s. c o  m
            }
        }
        return true;
    }

}

Related Tutorials