Program: 164546
Project: 164546
Buggy source:
private void validateSuccess(boolean bounded,List<Integer> attendeesNr,Event event,String username,List<TicketCategory> existingCategories,Result<Pair<TicketReservation,List<Ticket>>> result,List<Attendee> allAttendees,int expectedEventSeats,int reservedTickets){
  assertTrue(result.isSuccess());
  Pair<TicketReservation,List<Ticket>> data=result.getData();
  assertTrue(data.getRight().size() == attendeesNr.stream().mapToInt(i -> i).sum());
  assertNotNull(data.getLeft());
  Event modified=eventManager.getSingleEvent(event.getShortName(),username);
  assertEquals(expectedEventSeats,modified.getAvailableSeats());
  List<Ticket> tickets=ticketRepository.findPendingTicketsInCategories(existingCategories.stream().map(TicketCategory::getId).collect(toList()));
  assertEquals(attendeesNr.stream().mapToInt(i -> i).sum(),tickets.size() - reservedTickets);
  if (bounded) {
    final Iterator<Integer> iterator=attendeesNr.iterator();
    existingCategories.forEach(existingCategory -> {
      TicketCategory categoryModified=ticketCategoryRepository.getById(existingCategory.getId(),event.getId());
      assertEquals(categoryModified.getMaxTickets(),iterator.next().intValue());
    }
);
  }
  for (int i=0; i < tickets.size() - reservedTickets; i++) {
    Attendee attendee=allAttendees.get(i);
    if (!attendee.isEmpty()) {
      Ticket ticket=data.getRight().get(i);
      assertTrue(ticket.getAssigned());
      assertEquals(attendee.getFullName(),ticket.getFullName());
      assertEquals(attendee.getEmailAddress(),ticket.getEmail());
    }
  }
  ticketCategoryRepository.findByEventId(modified.getId()).forEach(tc -> assertTrue(specialPriceRepository.findAllByCategoryId(tc.getId()).stream().allMatch(sp -> sp.getStatus() == SpecialPrice.Status.PENDING)));
}

Fixed version (ground truth):
private void validateSuccess(boolean bounded,List<Integer> attendeesNr,Event event,String username,List<TicketCategory> existingCategories,Result<Pair<TicketReservation,List<Ticket>>> result,List<Attendee> allAttendees,int expectedEventSeats,int reservedTickets){
  assertTrue(result.isSuccess());
  Pair<TicketReservation,List<Ticket>> data=result.getData();
  assertTrue(data.getRight().size() == attendeesNr.stream().mapToInt(i -> i).sum());
  assertNotNull(data.getLeft());
  Event modified=eventManager.getSingleEvent(event.getShortName(),username);
  assertEquals(expectedEventSeats,modified.getAvailableSeats());
  List<Ticket> tickets=ticketRepository.findPendingTicketsInCategories(existingCategories.stream().map(TicketCategory::getId).collect(toList()));
  assertEquals(attendeesNr.stream().mapToInt(i -> i).sum(),tickets.size() - reservedTickets);
  if (bounded) {
    final Iterator<Integer> iterator=attendeesNr.iterator();
    existingCategories.forEach(existingCategory -> {
      TicketCategory categoryModified=ticketCategoryRepository.getById(existingCategory.getId(),event.getId());
      assertEquals(categoryModified.getMaxTickets(),iterator.next().intValue());
    }
);
  }
  for (int i=0; i < tickets.size() - reservedTickets; i++) {
    Attendee attendee=allAttendees.get(i);
    if (!attendee.isEmpty()) {
      Ticket ticket=data.getRight().get(i);
      assertTrue(ticket.getAssigned());
      assertEquals(attendee.getFullName(),ticket.getFullName());
      assertEquals(attendee.getEmailAddress(),ticket.getEmail());
      assertEquals(data.getLeft().getId(),ticket.getTicketsReservationId());
    }
  }
  ticketCategoryRepository.findByEventId(modified.getId()).forEach(tc -> assertTrue(specialPriceRepository.findAllByCategoryId(tc.getId()).stream().allMatch(sp -> sp.getStatus() == SpecialPrice.Status.PENDING)));
}