fun <T> newSameSize(list: List<*>?, cpType: Class<T>?): Array<T>? { return if (list == null) create(cpType, 0) else create(cpType, list.size) }
Creates an array with the same size as the given list . If the list is null , a zero-length array is created .