open class Person(val id: Int, val fullName: String) class Student(id: Int, fullName: String, val graduationYear: Int) : Person(id, fullName) { companion object } // In test file: val Student.Companion.test = Student(id = 1, fullName = "john smith", graduationYear = 2020) class StudentTest { lateinit var testSubject: Student @BeforeAll fun setUp() { testSubject = Student.test } }