check if an object is a list or map
object
static bool isListOrMap(Object object) { return object is Map || object is List; }