Program: 36735
Project: 36735
Buggy source:
@Test public void read_FOUND() throws UnexpectedInputException, ParseException, NonTransientResourceException, Exception {
  Judgment firstJudgment=createCcJudgment(1);
  Judgment secondJudgment=createCcJudgment(2);
  Judgment thirdJudgment=createCcJudgment(3);
  Page<Judgment> firstPage=new PageImpl<Judgment>(Lists.newArrayList(firstJudgment,secondJudgment),new PageRequest(0,2),3);
  Page<Judgment> secondPage=new PageImpl<Judgment>(Lists.newArrayList(thirdJudgment),new PageRequest(1,1),3);
  Page<Judgment> thirdPage=new PageImpl<Judgment>(Lists.newArrayList());
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) OngoingStubbing<Page<Judgment>> thenReturn=when(judgmentRepository.findAllToIndex(any(Pageable.class))).thenReturn(firstPage,secondPage,thirdPage);
  Judgment actualFirst=judgmentIndexingReader.read();
  Judgment actualSecond=judgmentIndexingReader.read();
  Judgment actualThird=judgmentIndexingReader.read();
  Judgment actualFourth=judgmentIndexingReader.read();
  ArgumentCaptor<Pageable> pageArgCapture=ArgumentCaptor.forClass(Pageable.class);
  verify(judgmentRepository,atLeast(2)).findAllToIndex(pageArgCapture.capture());
  Pageable firstPageRequestArg=pageArgCapture.getAllValues().get(0);
  assertEquals(0,firstPageRequestArg.getPageNumber());
  Pageable secondPageRequestArg=pageArgCapture.getAllValues().get(1);
  assertEquals(1,secondPageRequestArg.getPageNumber());
  assertEquals(firstJudgment.getId(),actualFirst.getId());
  assertEquals(secondJudgment.getId(),actualSecond.getId());
  assertEquals(thirdJudgment.getId(),actualThird.getId());
  assertNull(actualFourth);
}

Fixed version (ground truth):
@Test public void read_FOUND() throws UnexpectedInputException, ParseException, NonTransientResourceException, Exception {
  Judgment firstJudgment=createCcJudgment(1);
  Judgment secondJudgment=createCcJudgment(2);
  Judgment thirdJudgment=createCcJudgment(3);
  Page<Judgment> firstPage=new PageImpl<Judgment>(Lists.newArrayList(firstJudgment,secondJudgment),new PageRequest(0,2),3);
  Page<Judgment> secondPage=new PageImpl<Judgment>(Lists.newArrayList(thirdJudgment),new PageRequest(0,1),1);
  Page<Judgment> thirdPage=new PageImpl<Judgment>(Lists.newArrayList());
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) OngoingStubbing<Page<Judgment>> thenReturn=when(judgmentRepository.findAllToIndex(any(Pageable.class))).thenReturn(firstPage,secondPage,thirdPage);
  Judgment actualFirst=judgmentIndexingReader.read();
  Judgment actualSecond=judgmentIndexingReader.read();
  Judgment actualThird=judgmentIndexingReader.read();
  Judgment actualFourth=judgmentIndexingReader.read();
  ArgumentCaptor<Pageable> pageArgCapture=ArgumentCaptor.forClass(Pageable.class);
  verify(judgmentRepository,atLeast(2)).findAllToIndex(pageArgCapture.capture());
  Pageable firstPageRequestArg=pageArgCapture.getAllValues().get(0);
  assertEquals(0,firstPageRequestArg.getPageNumber());
  assertEquals(2,firstPageRequestArg.getPageSize());
  Pageable secondPageRequestArg=pageArgCapture.getAllValues().get(1);
  assertEquals(0,secondPageRequestArg.getPageNumber());
  assertEquals(2,secondPageRequestArg.getPageSize());
  assertEquals(firstJudgment.getId(),actualFirst.getId());
  assertEquals(secondJudgment.getId(),actualSecond.getId());
  assertEquals(thirdJudgment.getId(),actualThird.getId());
  assertNull(actualFourth);
}