package Ġcom . github . fs bar ata . functional . data . maybe Ċ Ċ import Ġcom . github . fs bar ata . functional . data . Mon oid Sem ig roup Factory Ċ import Ġcom . github . fs bar ata . functional . data . mon oid . concat String Mon oid Ċ import Ġcom . github . fs bar ata . functional . data . sem ig roup Factory Ċ import Ġcom . github . fs bar ata . functional . data . String F Ċ import Ġcom . github . fs bar ata . functional . data . Mon oid L aws Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Test Ċ Ċ class ĠOptional Mon oid Test : ĠMon oid L aws < Optional < String F >>( Ċ ĉ Optional . mon oid (), Ċ ) Ġ{ Ċ ĉ override Ġval Ġpossib ilities : ĠInt Ġ= Ġ 1 0 0 Ċ ĉ override Ġfun Ġfactory ( poss ibility : ĠInt ) Ġ= ĠOptional . just ( String F ("$ poss ibility ")) ĊĊ ĉ @ Test Ċ ĉ fun Ġcombin es () Ġ{ Ċĉ ĉ val Ġsem ig roup Factory Ġ= Ġconcat String Mon oid (). sem ig roup Factory () Ċĉ ĉ with ( Optional . mon oid < Mon oid Sem ig roup Factory < String >. Wrapped Mon oid >()) Ġ{ Ċĉĉ ĉ assertEquals ( Ċĉĉĉ ĉ Optional . just ( sem ig roup Factory (" 5 ")), Ċĉĉĉ ĉ combine ( Optional . just ( sem ig roup Factory (" 5 ")), ĠOptional . empty ()) Ċĉĉ ĉ ) ĊĊĉĉ ĉ assertEquals ( Ċĉĉĉ ĉ Optional . just ( sem ig roup Factory (" 2 ")), Ċĉĉĉ ĉ combine ( Optional . empty (), ĠOptional . just ( sem ig roup Factory (" 2 "))) Ċĉĉ ĉ ) ĊĊĉĉ ĉ assertEquals ( Ċĉĉĉ ĉ Optional . just ( sem ig roup Factory (" 4 2 ")), Ċĉĉĉ ĉ combine ( Optional . just ( sem ig roup Factory (" 4 ")), ĠOptional . just ( sem ig roup Factory (" 2 "))) Ċĉĉ ĉ ) Ċĉ ĉ } Ċ ĉ } Ċ }