package Ġcom . github . ch ristop h pick l . k pot p our ri . test 4 k . ham k rest _ matcher Ċ Ċ import Ġcom . github . ch ristop h pick l . k pot p our ri . test 4 k . assert Thrown Ċ import Ġcom . nat pr y ce . ham k rest . Match Result Ċ import Ġcom . nat pr y ce . ham k rest . assertion . assertThat Ċ import Ġorg . testng . annotations . Test Ċ Ċ @ Test Ġclass ĠMap Test Ġ{ ĊĊĠĠĠ Ġfun Ġ` map ContainsKey Ġ- Ġok `() Ġ{ ĊĠĠĠĠĠĠĠ Ġmap ContainsKey < String , ĠString >(" a "). invoke ( map Of (" a " Ġto Ġ" b ")) Ġshould Match Value ĠMatch Result . Match ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map ContainsKey Ġ- Ġnok `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( map ContainsKey < String , ĠString >(" a "). invoke ( empty Map ()), Ġis A ( Match Result . Mismatch :: class )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Ġ- ĠGiven Ġexact Ġmap , ĠShould Ġnot Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( map Of (" a " Ġto Ġ" b "), Ġmap Contains (" a " Ġto Ġ" b ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Ġ- ĠGiven Ġmore Ġentries Ġbut Ġwith Ġexpected Ġentry , ĠShould Ġnot Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( map Of (" a " Ġto Ġ" b ", Ġ" c " Ġto Ġ" d "), Ġmap Contains (" a " Ġto Ġ" b ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Ġ- ĠGiven Ġempty Ġmap , ĠShould Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ Ġassert Thrown < AssertionError > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( empty Map (), Ġmap Contains (" a " Ġto Ġ" b ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Ġ- ĠGiven Ġinvalid Ġentries , ĠShould Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ Ġassert Thrown < AssertionError > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( map Of (" x " Ġto Ġ" y "), Ġmap Contains (" a " Ġto Ġ" b ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Exactly Ġ- ĠGiven Ġexact Ġmap , ĠShould Ġnot Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( map Of (" a " Ġto Ġ" b "), Ġmap Contains Exactly (" a " Ġto Ġ" b ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Exactly Ġ- ĠGiven Ġcorrect Ġbut Ġalso Ġadditional Ġentry , ĠShould Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ Ġassert Thrown < AssertionError > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( map Of (" a " Ġto Ġ" b ", Ġ" c " Ġto Ġ" d "), Ġmap Contains Exactly (" a " Ġto Ġ" b ")) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Exactly Ġ- ĠGiven Ġempty Ġmap , ĠShould Ġnot Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( empty Map < String , ĠString >(), Ġmap Contains Exactly ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` map Contains Exactly Ġ- ĠGiven Ġexact Ġmap Ġwith Ġtwo Ġelements , ĠShould Ġnot Ġthrow `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( map Of (" a " Ġto Ġ" b ", Ġ" c " Ġto Ġ" d "), Ġmap Contains Exactly (" a " Ġto Ġ" b ", Ġ" c " Ġto Ġ" d ")) ĊĠĠĠ Ġ} Ċ Ċ } Ċ