Here you can find the source of toCollection(Object o)
public static Collection toCollection(Object o)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Collections; public class Main { public static Collection toCollection(Object o) { if (o == null) { return Collections.emptyList(); } else {//from w w w .ja v a2 s . c o m return Collections.singletonList(o); } } }