### Question:
TeamRenderer implements ModelRenderer<Team, Integer> { @WorkerThread @Override public @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args) { Team team = mDatafeed.fetchTeam(key).toBlocking().first(); if (team == null) { return null; } return renderFromModel(team, RENDER_BASIC); } @Inject  TeamRenderer(APICache datafeed); @WorkerThread @Override @Nullable TeamListElement renderFromKey(String key, ModelType type, Integer args); @WorkerThread @Override @Nullable TeamListElement renderFromModel(Team team, @RenderType Integer renderType); static final int RENDER_BASIC; static final int RENDER_DETAILS_BUTTON; static final int RENDER_MYTBA_DETAILS; }### Answer:
@Test public void testRenderFromKey() { when(mDatafeed.fetchTeam(TEAM_KEY)).thenReturn(Observable.just(mTeam)); TeamListElement element = mRenderer.renderFromKey(TEAM_KEY, ModelType.TEAM, null); assertTeamElement(element, false); }
@Test public void testNullRenderFromKey() { when(mDatafeed.fetchTeam(TEAM_KEY)).thenReturn(Observable.just(null)); TeamListElement element = mRenderer.renderFromKey(TEAM_KEY, ModelType.TEAM, null); assertNull(element); }