import Ġkotlin . reflect . K Class Ċ import Ġkotlin . reflect . full .* Ċ import Ġkotlin . test . assertTrue Ċ import Ġkotlin . test . assertFalse Ċ open Ġclass ĠK lass Ċ interface ĠInterface < T > Ċ class ĠBar : ĠInterface < String >, ĠK lass () ĊĊ Ċ fun Ġcheck ( subclass : ĠK Class <* >, Ġsuperclass : ĠK Class <* >, ĠshouldBe Subclass : ĠBoolean ): ĠUnit Ġ{ Ċ if Ġ( shouldBe Subclass ) Ġ{ Ċ assertTrue ( subclass . is Subclass Of ( super class )) Ċ assertTrue ( super class . is Super class Of ( subclass )) Ċ } Ġelse Ġ{ Ċ assertFalse ( subclass . is Subclass Of ( super class )) Ċ assertFalse ( super class . is Super class Of ( subclass )) Ċ } Ċ } Ċ fun Ġbox (): ĠString Ġ{ Ċ check ( Any :: class , ĠAny :: class , Ġtrue ) Ċ check ( String :: class , ĠAny :: class , Ġtrue ) Ċ check ( Any :: class , ĠString :: class , Ġfalse ) Ċ check ( String :: class , ĠString :: class , Ġtrue ) Ċ check ( Int :: class , ĠInt :: class , Ġtrue ) Ċ check ( Int :: class , ĠAny :: class , Ġtrue ) Ċ check ( List :: class , ĠCollection :: class , Ġtrue ) Ċ check ( List :: class , ĠIterable :: class , Ġtrue ) Ċ check ( Collection :: class , ĠIterable :: class , Ġtrue ) Ċ check ( Set :: class , ĠList :: class , Ġfalse ) Ċ check ( Array < String >:: class , ĠArray < Any >:: class , Ġfalse ) Ċ check ( Array < Any >:: class , ĠArray < String >:: class , Ġfalse ) Ċ check ( Function 3 :: class , ĠFunction 4 :: class , Ġfalse ) Ċ check (( Function 4 )? :: class , ĠFunction 3 :: class , Ġfalse ) Ċ check ( Bar :: class , ĠK lass :: class , Ġtrue ) Ċ check ( Bar :: class , ĠInterface :: class , Ġtrue ) Ċ check ( K lass :: class , ĠBar :: class , Ġfalse ) Ċ check ( Interface :: class , ĠBar :: class , Ġfalse ) Ċ check ( K lass :: class , ĠInterface :: class , Ġfalse ) Ċ return Ġ" OK " Ċ }