By using java reflection, we can easily know if an object is an array. What\'s the easiest way to tell if an object is a collection(Set,List,Map,Vector...)?
Test if the object implements either java.util.Collection or java.util.Map. (Map has to be tested separately because it isn't a sub-interface of Collection.)