Evolve { public Stream<Course> getCourses() { PageFetcherCurrentAndTotalPagesSplitIterator<Course> iterator = new PageFetcherCurrentAndTotalPagesSplitIterator<>( pageToFetch -> { Courses courses = restTemplate.getForObject("courses?currentPage={currentPage}", Courses.class, pageToFetch); ListWithLastPage<Course> courseListWithLastPage = new ListWithLastPage<>(); courseListWithLastPage.setList(courses.getCourses()); courseListWithLastPage.setLastPage(courses.getTotalPages()); return courseListWithLastPage; }, 1); return StreamSupport.stream(iterator, false); } Evolve(RestTemplate restTemplate); Stream<Course> getCourses(); String getTranslationsByCourseId(String courseId); void createCourseTranslationsById(String courseId, String translatedCourse, String locale, boolean isRTL);  }
@Test public void getCourses() { Assume.assumeNotNull(evolve); Stream<Course> courses = evolve.getCourses(); courses.filter(c -> "inTranslation".equals(c.getState())).forEach(c -> logger.info("id: {}, state: {}", c.getId(), c.getState())); }