package Ġn inen ine . com . duplicate user . bench Ċ Ċ import Ġandroid . support . test . filters . Small Test Ċ import Ġandroid . support . test . rule . Activity Test Rule Ċ import Ġandroid . support . test . runner . Android JUnit 4 Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġn inen ine . com . duplicate user . repository . UserRepository Ċ import Ġn inen ine . com . duplicate user . repository . local . Local UserRepository Ċ import Ġn inen ine . com . duplicate user . ui . Users Activity Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġkotlin . system . measure Nano Time ĊĊ Ċ @ RunWith ( Android JUnit 4 :: class ) Ġ@ Small Test Ġclass ĠUser Bench Test Ġ{ ĊĊĠĠĠ Ġ@ Rule ĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġvar Ġm Activity Test Rule Ġ= ĠActivity Test Rule ( Users Activity :: class . java ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġbench _ getAll Users _ using Set (){ ĊĠĠĠĠĠĠĠ Ġval Ġuser Repository : ĠUser Repository ĊĠĠĠĠĠĠĠ Ġval Ġm oshi Ġ= ĠM oshi . Builder (). build () ĊĠĠĠĠĠĠĠ Ġuser Repository Ġ= ĠLocal UserRepository ( m Activity Test Rule . activity , Ġm oshi ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtime Elapsed Ġ= Ġmeasure Nano Time Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġuser Repository . get Users With Set () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġprintln (" Bench Test _ Set : Ġ$ time Elapsed ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġbench _ getAll Users _ using List Distinct (){ ĊĠĠĠĠĠĠĠ Ġval Ġuser Repository : ĠUser Repository ĊĠĠĠĠĠĠĠ Ġval Ġm oshi Ġ= ĠM oshi . Builder (). build () ĊĠĠĠĠĠĠĠ Ġuser Repository Ġ= ĠLocal UserRepository ( m Activity Test Rule . activity , Ġm oshi ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtime Elapsed Ġ= Ġmeasure Nano Time Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġuser Repository . get Users With List () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġprintln (" Bench Test _ Distinct : Ġ$ time Elapsed ") ĊĠĠĠ Ġ} ĊĊ Ċ }