Here you can find the source of contains(final List
public static boolean contains(final List<String> list, final String str)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static boolean contains(final List<String> list, final String str) { //Utility to check if given 'str' is present as substring in atleast one entry in the list. for (final String entry : list) if (entry.toLowerCase().contains(str.toLowerCase())) return true; return false; }// w w w. j a va2s . co m }