import Ġcom . google . gson . Gson Builder Ċ import Ġcom . google . gson . reflect . Type Token Ċ import Ġcom . m re ig osa . mar vel app . data . model . Mar vel Character Entity Ċ import Ġcom . m re ig osa . mar vel app . data . sources . local . mapper . Mar vel Character Local Entity Mapper Ċ import Ġcom . m re ig osa . mar vel app . data . sources . local . model . Mar vel Character Local Entity Ċ import Ġcom . m re ig osa . mar vel app . data . sources . remote . mapper . Mar vel Character Remote Entity Mapper Ċ import Ġcom . m re ig osa . mar vel app . data . sources . remote . model . Mar vel Character Data Wrapper Ċ Ċ object ĠMock DataProvider Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġgson Ġ= ĠGson Builder (). create () ĊĊĠĠĠ Ġconst Ġval ĠGET _ CHAR ACT ERS _ RESPONSE _ FILE Ġ= Ġ" get Characters ApiResponse . json " ĊĠĠĠ Ġconst Ġval ĠMOCK _ EMPTY _ CHAR ACT ERS _ JSON _ FILENAME Ġ= Ġ" get Characters Empty ApiResponse . json " ĊĊĠĠĠ Ġfun Ġgiven Mar vel Character Entity List (): ĠList < Mar vel Character Entity > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġremote Entities Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparse Json File < Mar vel Character Data Wrapper >( GET _ CHAR ACT ERS _ RESPONSE _ FILE ). data ?. results ĊĊĠĠĠĠĠĠĠ Ġreturn Ġremote Entities ?. map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMar vel Character Remote Entity Mapper . map From Remote ( it ) ĊĠĠĠĠĠĠĠ Ġ} Ġ?: ĠlistOf () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġgiven Mar vel Character Local Entity List (): ĠList < Mar vel Character Local Entity > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġgiven Mar vel Character Entity List (). map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMar vel Character Local Entity Mapper . map ToLocal ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġread Json AsString ( path : ĠString ): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstream Ġ= Ġthis . java Class . class Loader ?. getResource AsStream ( path ) Ġ?: Ġreturn Ġ"" ĊĠĠĠĠĠĠĠ Ġreturn Ġstream . buffered Reader (). use Ġ{ Ġbuffer Reader Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbuffer Reader . read Text () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġinline Ġfun Ġ< re ified ĠT > Ġparse Json File ( json Path : ĠString ): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġjson AsString Ġ= Ġread Json AsString ( json Path ) ĊĠĠĠĠĠĠĠ Ġreturn Ġgson . fromJson ( json AsString , Ġobject Ġ: ĠType Token < T >() Ġ{} . type ) ĊĠĠĠ Ġ} Ċ }