package Ġnet . ser ge y . kos ov . market . domains . entity Ċ Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Test Ċ Ċ internal Ġclass ĠCategory Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġoperator Ġfun Ġiterator () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcategory 1 Ġ= ĠCategory ( title Ġ= Ġ" root 1 ", Ġcharacteristics Ġ= ĠlistOf ( Characteristic (" 1 "))) ĊĠĠĠĠĠĠĠ Ġval Ġcategory 2 Ġ= ĠCategory ( title Ġ= Ġ" root 2 ", Ġparent Ġ= Ġcategory 1 , Ġcharacteristics Ġ= ĠlistOf ( Characteristic (" 2 "), ĠCharacter istic (" 2 2 "))) ĊĠĠĠĠĠĠĠ Ġval Ġcategory 3 Ġ= ĠCategory ( title Ġ= Ġ" root 3 ", Ġparent Ġ= Ġcategory 2 , Ġcharacteristics Ġ= ĠlistOf ( Characteristic (" 3 "))) ĊĠĠĠĠĠĠĠ Ġval Ġcategory 4 Ġ= ĠCategory ( title Ġ= Ġ" root 4 ", Ġparent Ġ= Ġcategory 3 , Ġcharacteristics Ġ= ĠlistOf ( Characteristic (" 4 "))) ĊĠĠĠĠĠĠĠ Ġval Ġflat Map Ġ= Ġcategory 4 . flatMap Ġ{ Ġc Ġ-> Ġc . character istics . map Ġ{ Ġit . name Ġ} Ġ} ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( listOf (" 4 ", Ġ" 3 ", Ġ" 2 ", Ġ" 2 2 ", Ġ" 1 "), Ġflat Map ) ĊĠĠĠ Ġ} Ċ }