@@ -292,16 +292,11 @@ public List<GHIssueComment> getComments() throws IOException {
292292 * Obtains all the comments associated with this issue.
293293 */
294294 public PagedIterable <GHIssueComment > listComments () throws IOException {
295- return new PagedIterable <GHIssueComment >() {
296- public PagedIterator <GHIssueComment > _iterator (int pageSize ) {
297- return new PagedIterator <GHIssueComment >(root .retrieve ().asIterator (getIssuesApiRoute () + "/comments" , GHIssueComment [].class , pageSize )) {
298- protected void wrapUp (GHIssueComment [] page ) {
299- for (GHIssueComment c : page )
300- c .wrapUp (GHIssue .this );
301- }
302- };
303- }
304- };
295+ return root .retrieve ()
296+ .asPagedIterable (
297+ getIssuesApiRoute () + "/comments" ,
298+ GHIssueComment [].class ,
299+ item -> item .wrapUp (GHIssue .this ) );
305300 }
306301
307302 @ Preview @ Deprecated
@@ -314,17 +309,11 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
314309
315310 @ Preview @ Deprecated
316311 public PagedIterable <GHReaction > listReactions () {
317- return new PagedIterable <GHReaction >() {
318- public PagedIterator <GHReaction > _iterator (int pageSize ) {
319- return new PagedIterator <GHReaction >(owner .root .retrieve ().withPreview (SQUIRREL_GIRL ).asIterator (getApiRoute ()+"/reactions" , GHReaction [].class , pageSize )) {
320- @ Override
321- protected void wrapUp (GHReaction [] page ) {
322- for (GHReaction c : page )
323- c .wrap (owner .root );
324- }
325- };
326- }
327- };
312+ return owner .root .retrieve ().withPreview (SQUIRREL_GIRL )
313+ .asPagedIterable (
314+ getApiRoute ()+"/reactions" ,
315+ GHReaction [].class ,
316+ item -> item .wrap (owner .root ) );
328317 }
329318
330319 public void addAssignees (GHUser ... assignees ) throws IOException {
0 commit comments