String implements java.lang.CharSequence, and:import java.util.*;public class LongWordFinder { public static void main(String[] args) { String[] array = { "123", "12345678", "1", "12", "1234567890"}; List < String > list = Arrays.asList(array); Collection < String > resultList = getLongWords(list); } /* INSERT DECLARATION HERE*/ { Collection < E > longWords = new ArrayList < E > (); for (E word : coll) if (word.length() > 6) longWords.add(word); return longWords; } }
public static < E extends CharSequence > Collection < ? extends CharSequence > getLongWords(Collection < E > coll)
public static < E extends CharSequence > List < E > getLongWords(Collection < E > coll)
public static Collection < E extends CharSequence > getLongWords(Collection < E > coll)
public static List < CharSequence >getLongWords(Collection < CharSequence > coll)
public static List < ? extends CharSequence >getLongWords(Collection < ? extends CharSequence > coll)
static public < E extends CharSequence > Collection < E >getLongWords(Collection < E > coll)
static public < E super CharSequence > Collection < E >getLongWords(Collection < E > coll)