package Ġpl . po zn an . put . mio ib . algorithm . mut ators . random Ċ Ċ import Ġcom . n ha ar man . mockito _ kotlin . any Ċ import Ġcom . n ha ar man . mockito _ kotlin . do Return Ċ import Ġcom . n ha ar man . mockito _ kotlin . mock Ċ import Ġorg . junit . jupiter . api . Assertions Ċ import Ġorg . junit . jupiter . api . Assertions . assertEquals Ċ import Ġorg . junit . jupiter . api . Assertions . assertNot Equals Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġpl . po zn an . put . mio ib . algorithm . weight . Solution Evaluator Ċ import Ġpl . po zn an . put . mio ib . model . Solution Proposal Ċ import Ġkotlin . random . Random Ċ Ċ internal Ġclass ĠRandom Mut ator Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġis Predict able () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrand 1 Ġ= ĠRandom ( 1 2 ) ĊĠĠĠĠĠĠĠ Ġval Ġmut 1 Ġ= ĠRandom Mut ator ( rand 1 , Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġval Ġfirst Solution Ġ= ĠSolution Proposal ( int ArrayOf ( 1 , Ġ 2 , Ġ 3 ), Ġ 1 0 . 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġeval Ġ= Ġmock < Solution Evaluator > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon Ġ{ Ġsolution ( any ()) Ġ} Ġdo Return Ġ( 2 0 . 0 ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġfirst Ġ= Ġmut 1 . mutate ( first Solution , Ġeval ) ĊĠĠĠĠĠĠĠ Ġval Ġsecond Ġ= Ġmut 1 . mutate ( first Solution , Ġeval ) ĊĠĠĠĠĠĠĠ Ġassert Not Equals ( first , Ġsecond ) Ġ{ Ġ" solutions Ġshould Ġdiffer " Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġrand 2 Ġ= ĠRandom ( 1 2 ) ĊĠĠĠĠĠĠĠ Ġval Ġmut 2 Ġ= ĠRandom Mut ator ( rand 2 , Ġ 2 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( first , Ġmut 2 . mutate ( first Solution , Ġeval )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( second , Ġmut 2 . mutate ( first Solution , Ġeval )) ĊĠĠĠ Ġ} Ċ } Ċ