### Question:
EventRenderer implements ModelRenderer<Event, Boolean> { @WorkerThread @Override public @Nullable EventListElement renderFromKey(String key, ModelType type, Boolean args) { Event event = mDatafeed.fetchEvent(key).toBlocking().first(); if (event == null) { return null; } return renderFromModel(event, false); } @Inject  EventRenderer(APICache datafeed); @WorkerThread @Override @Nullable EventListElement renderFromKey(String key, ModelType type, Boolean args); @WorkerThread @Override @Nullable EventListElement renderFromModel(Event event, Boolean showMyTbaSettings); @WorkerThread List<WebcastListElement> renderWebcasts(Event event); @WorkerThread void renderAlliances(List<EventAlliance> alliances, List<ListItem> destList);  }### Answer:
@Test public void testRenderFromKey() { when(mDatafeed.fetchEvent(EVENT_KEY)).thenReturn(Observable.just(mEvent)); EventListElement element = mRenderer.renderFromKey(EVENT_KEY, ModelType.EVENT, null); assertNotNull(element); assertEquals(element.getEventKey(), EVENT_KEY); assertEquals(element.showMyTba, false); }
@Test public void testNullRenderFromKey() { when(mDatafeed.fetchEvent(EVENT_KEY)).thenReturn(Observable.just(null)); EventListElement element = mRenderer.renderFromKey(EVENT_KEY, ModelType.EVENT, null); assertNull(element); }