Here you can find the source of convertToCollection(Object source)
private static Object convertToCollection(Object source)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { private static Object convertToCollection(Object source) { if (source == null) { return null; }/* www. java 2 s. co m*/ if (source instanceof Collection) { return source; } return Collections.singleton(source); } }