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

booleancontainsAnyOf(Exception e, List nonRetryableKeywords)
contains Any Of
Throwable currentException = e;
while (currentException != null) {
    String exceptionMessage = currentException.getMessage();
    for (String keyword : nonRetryableKeywords) {
        if (exceptionMessage != null && exceptionMessage.contains(keyword)) {
            return true;
    currentException = currentException.getCause();
return false;
booleancontainsArgument(List argList, Option option)
contains Argument
List<String> options = new ArrayList<String>();
options.add(option.name());
options.addAll(Arrays.asList(option.aliases()));
for (String s : options) {
    if (argList.contains(s))
        return true;
return false;
...
booleancontainsAtLeastAValue(List values)
contains At Least A Value
return values != null && !values.isEmpty();
booleancontainsAtLeastOneElement(List l1, List l2)
contains At Least One Element
if (l1 == null || l2 == null)
    return false;
for (String s : l1) {
    if (l2.contains(s))
        return true;
return false;
booleancontainsBasedOnEntryIdentity(final List list, final Object object)
contains Based On Entry Identity
for (Object obj : list) {
    if (obj == object) {
        return true;
return false;
booleancontainsCaseInsensitive(String s, List l)
Returns true if this list contains the specified string element, ignoring case considerations.
for (String listItem : l) {
    if (listItem.equalsIgnoreCase(s)) {
        return true;
return false;
booleancontainsColumnByAlias(List columns, String alias)
contains Column By Alias
for (String column : columns) {
    if (getColumnAlias(column).equals(alias)) {
        return true;
return false;
booleancontainsDuplicates(List list, Comparator comparator)
Checks whether the given list contains duplicates.
Collections.sort(list, comparator);
T previous = null;
for (T entry : list) {
    if (previous != null && previous.equals(entry)) {
        return true;
    previous = entry;
return false;
booleancontainsElement(List> list, List element)
contains Element
boolean found = false;
for (List<E> e : list) {
    if (isEqual(element, e)) {
        found = true;
        break;
return found;
...
booleancontainsEnchantment(String enchantments, List enchList)
contains Enchantment
return false;