object ItemCache : ItemDataStore { override fun items(): Observable<List<Item>> { // Return cached items } fun reset(newItemList: List<Item>) { // Replace cached items } fun isCached(): Boolean { // Cache data exists? } } class ItemApi(cache: ItemCache) : ItemDataStore { val cache = cache override fun items(): Observable<List<Item>> { val retrofit = Retrofit.Builder()...build() val service = retrofit.create(ItemService::class.java) return service.items().doOnNext { cache.reset(it) } } } https://gist.github.com/bl-lia/23023d968ab884708f30