// WITH_RUNTIME // FULL_JDK @file:JvmName("TestKt") package test import kotlinx.parcelize.* import android.os.Parcel import android.os.Parcelable import java.util.* @Parcelize data class Test( val a: List, val b: MutableList, val c: ArrayList, val d: LinkedList, val e: Set, val f: MutableSet, val g: TreeSet, val h: HashSet, val i: LinkedHashSet, val j: NavigableSet, val k: SortedSet ) : Parcelable fun box() = parcelTest { parcel -> val first = Test( a = listOf("A"), b = mutableListOf("B"), c = ArrayList().apply { this += "C" }, d = LinkedList().apply { this += "D" }, e = setOf("E"), f = mutableSetOf("F"), g = TreeSet().apply { this += "G" }, h = HashSet().apply { this += "H" }, i = LinkedHashSet().apply { this += "I" }, j = TreeSet().apply { this += "J" }, k = TreeSet().apply { this += "K" } ) first.writeToParcel(parcel, 0) val bytes = parcel.marshall() parcel.unmarshall(bytes, 0, bytes.size) parcel.setDataPosition(0) val first2 = parcelableCreator().createFromParcel(parcel) assert(first == first2) assert((first.d as LinkedList<*>).size == 1) assert((first2.h as HashSet<*>).size == 1) }