package Ġsh v yn 2 2 . flex ing final space . util Ċ Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġandroidx . test . espress o . View Assertion Ċ import Ġandroidx . test . espress o . matcher . View Matchers . assertThat Ċ import Ġorg . hamcrest . core . Is .` is ` Ċ Ċ fun Ġwith ItemCount ( ĊĠĠĠ Ġexpected Count : ĠInt Ċ ) Ġ= ĠView Assertion Ġ{ Ġview , Ġno View Found Exception Ġ-> ĊĊĠĠĠ Ġif Ġ( no View Found Exception Ġ!= Ġnull ) Ġthrow Ġno View Found Exception ĊĊĠĠĠ Ġval Ġre cyclerView Ġ= Ġview Ġas ĠRecyclerView ĊĠĠĠ Ġval Ġadapter Ġ= Ġre cyclerView . adapter ĊĊĠĠĠ ĠassertThat ( adapter ?. item Count , Ġ` is `( expected Count )) Ċ }