package Ġpl . sh ock ah . un ik orn . dependency Ċ Ċ import Ġorg . junit . jupiter . api . Assertions Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . function . Throw ing Supplier Ċ Ċ class ĠSub cl assed Component Test Ġ{ Ċ ĉ private Ġval Ġstorage Factory Ġ= ĠLazy Component Storage Factory () ĊĊ ĉ @ Test Ċ ĉ @ Suppress (" UN CHECK ED _ CAST ") Ċ ĉ fun Ġtest Subclass ing () Ġ{ Ċĉ ĉ val Ġcontainer Ġ= ĠContainer ( default Component Storage Factory Ġ= Ġstorage Factory ) ĊĊĉ ĉ container . register ( ArrayList < String >()) ĊĊĉ ĉ val Ġarray List Ġ= ĠAssertions . assert DoesNot Throw ( Throw ing Supplier Ġ{ Ġcontainer . resolve < ArrayList < String >>() Ġ}) Ċĉ ĉ val Ġmutable List Ġ= ĠAssertions . assert DoesNot Throw ( Throw ing Supplier Ġ{ Ġcontainer . resolve < Mutable List < String >>() Ġ}) Ċĉ ĉ val Ġlist Ġ= ĠAssertions . assert DoesNot Throw ( Throw ing Supplier Ġ{ Ġcontainer . resolve < List < String >>() Ġ}) ĊĊĉ ĉ Assertions . assertSame ( array List , Ġmutable List ) Ċĉ ĉ Assertions . assertSame ( mutable List , Ġlist ) Ċ ĉ } ĊĊ ĉ @ Test Ċ ĉ @ Suppress (" UN CHECK ED _ CAST ") Ċ ĉ fun Ġtest No Subclass ing () Ġ{ Ċĉ ĉ val Ġcontainer Ġ= ĠContainer ( default Component Storage Factory Ġ= Ġstorage Factory ) ĊĊĉ ĉ container . register ( ArrayList < String >()) ĊĊĉ ĉ Assertions . assert DoesNot Throw Ġ{ Ġcontainer . resolve < ArrayList < String >>( Resolver . Sub types . Exact Only ) Ġ} Ċĉ ĉ Assertions . assert Throws ( Missing Component Exception :: class . java ) Ġ{ Ġcontainer . resolve < Mutable List < String >>( Resolver . Sub types . Exact Only ) Ġ} Ċĉ ĉ Assertions . assert Throws ( Missing Component Exception :: class . java ) Ġ{ Ġcontainer . resolve < List < String >>( Resolver . Sub types . Exact Only ) Ġ} Ċ ĉ } Ċ }