Here you can find the source of toArrayList(Object pObject)
public static final List toArrayList(Object pObject)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static final List toArrayList(Object pObject) { List array;//ww w .j a v a2 s .c om // Catch null object if (pObject == null) { array = new ArrayList(1); } // Catch single String passed (Servlet parameter bug workaround) else if (pObject instanceof String) { array = new ArrayList(1); array.add(pObject); } // Process normal string array (Documented servlet processing) else { String[] lObjectArray = (String[]) pObject; array = new ArrayList(lObjectArray.length); for (int i = 0; i < lObjectArray.length; i++) { array.add(lObjectArray[i]); } } return array; } }