code: static boolean isCollectionOrArray(final Object obj) {
          final Class<?> cls = obj.getClass();
          return Collection.class.isAssignableFrom(cls) || cls.isArray();
      }
docs: Return true for objects that are collections or arrays (i.e. objects that are convertible to a JSON array).
  
  @param obj
  the object
  @return true, if the object is a collection or array