Here you can find the source of toCollection(String value)
public static Collection<String> toCollection(String value)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; public class Main { public static Collection<String> toCollection(String value) { if (value == null) { throw new IllegalArgumentException("Cannot add null value to collection."); }/*from w w w . ja va2 s .c o m*/ Collection<String> collection = new ArrayList<String>(); collection.add(value); return collection; } }