package Ġcom . unic orp dev . kt at r act . shared . extensions Ċ Ċ import Ġcom . google . common . truth . Truth Ċ import Ġcom . unic orp dev . kt at r act . models . Tr act Ċ import Ġcom . unic orp dev . kt at r act . models . Tr act Picture Ċ import Ġjunit . framework . TestCase Ċ Ċ class ĠTr act List Extension Kt Test Ġ: ĠTestCase () Ġ{ ĊĊĠĠĠ Ġfun Ġtest Merge With P ictures () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtr act 1 Ġ= ĠTr act () ĊĠĠĠĠĠĠĠ Ġval Ġtr act 2 Ġ= ĠTr act () ĊĠĠĠĠĠĠĠ Ġval Ġtr acts Ġ= ĠlistOf ( tract 1 , Ġtr act 2 ) ĊĠĠĠĠĠĠĠ Ġval Ġpictures Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTr act Picture ( tract Id Ġ= Ġtr act 1 . id ), ĠTr act Picture ( tract Id Ġ= Ġtr act 2 . id ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTr act Picture ( tract Id Ġ= Ġtr act 1 . id ), ĠTr act Picture ( tract Id Ġ= Ġtr act 1 . id ) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġtr acts . merge With P ictures ( pictures ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( result . size ). isEqualTo ( tract s . size ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtr act With Picture 1 Ġ= Ġresult . find Ġ{ Ġit . tract Ġ== Ġtr act 1 Ġ} ĊĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( tract With Picture 1 ). isNotNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( tract With Picture 1 ?. pictures ?. size ). isEqualTo ( 3 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtr act With Picture 2 Ġ= Ġresult . find Ġ{ Ġit . tract Ġ== Ġtr act 2 Ġ} ĊĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( tract With Picture 2 ). isNotNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( tract With Picture 2 ?. pictures ?. size ). isEqualTo ( 1 ) ĊĠĠĠ Ġ} Ċ }