Here you can find the source of stringContainsOneOfStringsFromCollection(final String pattern, final Collection
private static boolean stringContainsOneOfStringsFromCollection(final String pattern, final Collection<String> collection)
//package com.java2s; import java.util.Collection; public class Main { private static boolean stringContainsOneOfStringsFromCollection(final String pattern, final Collection<String> collection) { boolean result = false; for (final String string : collection) { if (pattern.contains(string)) { result = true;/* w ww .ja v a 2 s . co m*/ break; } } return result; } }