### Question:
CreditDisplayableItemMapper implements Function<List<CreditDraft>, List<DisplayableItem>> { @Override public List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts) throws Exception { return Observable.fromIterable(creditDrafts) .map(inRepaymentCardViewEntityMapper) .map(this::wrapInDisplayableItem) .toList() .blockingGet(); } @Inject  CreditDisplayableItemMapper(@NonNull final InRepaymentCardViewEntityMapper inRepaymentCardViewEntityMapper); @Override List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts);  }### Answer:
@Test public void creditDraftsAreMappedToViewEntities() throws Exception { CreditDraft creditDraft = Mockito.mock(CreditDraft.class); new ArrangeBuilder().withMappedViewEntity(Mockito.mock(InRepaymentCardViewEntity.class)); displayableItemMapper.apply(Collections.singletonList(creditDraft)); Mockito.verify(viewEntityMapper).apply(creditDraft); }
@Test public void viewEntityIsWrappedInDisplayableItem() throws Exception { CreditDraft creditDraft = Mockito.mock(CreditDraft.class); InRepaymentCardViewEntity viewEntity = Mockito.mock(InRepaymentCardViewEntity.class); new ArrangeBuilder().withMappedViewEntity(viewEntity); List<DisplayableItem> items = displayableItemMapper.apply(Collections.singletonList(creditDraft)); List<DisplayableItem> expected = Collections.singletonList(DisplayableItem.toDisplayableItem(viewEntity, IN_REPAYMENT)); assertThat(items).isEqualTo(expected); }