Java Utililty Methods List Contain

List of utility methods to do List Contain

Description

The list of methods to do List Contain are organized into topic(s).

Method

booleancontainsExactly(Collection list, T... mustHaveItems)
Checks if the collection contains exactly the given mustHaveItems.
return containsExactly(list, Arrays.asList(mustHaveItems));
booleancontainsExactly(List items, T... itemsToMatch)
contains Exactly
if (items.size() != itemsToMatch.length) {
    return false;
for (int i = 0; i < items.size(); i++) {
    if (!items.get(i).equals(itemsToMatch[i])) {
        return false;
return true;
booleancontainsExternalFilter(List filterList, String dataSetExtId, String dataSourceExtId)
contains External Filter
return false;
booleancontainsFileName(String fileName, List filterList)
contains File Name
if (filterList == null || filterList.size() == 0) {
    return true;
for (String filter : filterList) {
    if (fileName.contains(filter)) {
        return true;
return false;
booleancontainsHelpRequest(List args)
contains Help Request
boolean containsHelp = false;
for (String arg : args) {
    if (isHelpRequest(arg)) {
        containsHelp = true;
        break;
return containsHelp;
...
booleancontainsId(List aList, Object anObj)
Returns whether list contains identical given object (accepts null list).
return indexOfId(aList, anObj) >= 0;
BooleancontainsIgnoreCase(final String candidate, final List options)
contains Ignore Case
for (String option : options) {
    if (option.equalsIgnoreCase(candidate)) {
        return true;
return false;
BooleancontainsIgnoreCase(final String string, final List list)
contains Ignore Case
for (Object object : list) {
    if (string.toLowerCase().contains(object.toString().toLowerCase())) {
        return true;
return false;
booleancontainsIgnoreCase(List list, String strIn)
contains Ignore Case
boolean result = false;
if (strIn != null) 
    if (list != null) 
        for (Iterator iter = list.iterator(); iter.hasNext();) {
            String str = (String) iter.next();
            if (strIn.equalsIgnoreCase(str)) {
...
booleancontainsIgnoreCase(List list, String findMe)
contains Ignore Case
for (String s : list) {
    if (findMe.equalsIgnoreCase(s)) {
        return true;
return false;