RepoContributorsMapper implements Func1<List<ContributorDTO>, List<Contributor>> { @Override public List<Contributor> call(List<ContributorDTO> contributorDTOs) { if (contributorDTOs == null) { return null; } List<Contributor> contributors = Observable.from(contributorDTOs) .map(contributorDTO -> new Contributor(contributorDTO.getLogin())) .toList() .toBlocking() .first(); return contributors; } @Inject  RepoContributorsMapper(); @Override List<Contributor> call(List<ContributorDTO> contributorDTOs);  }
@Test public void testCall() throws Exception { List<Contributor> contributorList = repoContributorsMapper.call(contributorDTOs); assertEquals(11, contributorList.size()); assertEquals("hotchemi", contributorList.get(0).getName()); assertEquals("mrmike", contributorList.get(1).getName()); assertEquals("amitkot", contributorList.get(2).getName()); assertEquals("maarekj", contributorList.get(10).getName()); }