@Test public void canGetAllTheBodies() { PagedList<String> list = new PagedList<>(); list.addAll(asList( mkRequest("foo"), mkRequest("bar"), mkRequest("baz") )); List<String> bodies = list.getBodies(); assertEquals(Arrays.asList("foo","bar","baz"), bodies); }
public List<T> getBodies() { return stream() .filter(HttpResponse::isSuccess) .map(HttpResponse::getBody) .collect(Collectors.toList()); }
PagedList extends ArrayList<HttpResponse<T>> { public List<T> getBodies() { return stream() .filter(HttpResponse::isSuccess) .map(HttpResponse::getBody) .collect(Collectors.toList()); } }
PagedList extends ArrayList<HttpResponse<T>> { public List<T> getBodies() { return stream() .filter(HttpResponse::isSuccess) .map(HttpResponse::getBody) .collect(Collectors.toList()); }  }
PagedList extends ArrayList<HttpResponse<T>> { public List<T> getBodies() { return stream() .filter(HttpResponse::isSuccess) .map(HttpResponse::getBody) .collect(Collectors.toList()); }  List<T> getBodies(); PagedList<T> ifSuccess(Consumer<HttpResponse<T>> consumer); PagedList<T> ifFailure(Consumer<HttpResponse<T>> consumer); }
PagedList extends ArrayList<HttpResponse<T>> { public List<T> getBodies() { return stream() .filter(HttpResponse::isSuccess) .map(HttpResponse::getBody) .collect(Collectors.toList()); }  List<T> getBodies(); PagedList<T> ifSuccess(Consumer<HttpResponse<T>> consumer); PagedList<T> ifFailure(Consumer<HttpResponse<T>> consumer);  }