private CardGenerationBatch findOrCreate(
     final ExecutionYear executionYear, final String description) {
   for (final CardGenerationBatch cardGenerationBatch :
       executionYear.getCardGenerationBatchesSet()) {
     if (cardGenerationBatch.getDescription() != null
         && cardGenerationBatch.getDescription().equals(description)) {
       return cardGenerationBatch;
     }
   }
   return new CardGenerationBatch(description, executionYear, true);
 }
  private static StudentCurricularPlan findStudentCurricularPlan(
      final CardGenerationBatch cardGenerationBatch, final Student student) {
    final ExecutionYear executionYear = cardGenerationBatch.getExecutionYear();
    final DateTime begin = executionYear.getBeginDateYearMonthDay().toDateTimeAtMidnight();
    final DateTime end = executionYear.getEndDateYearMonthDay().toDateTimeAtMidnight();
    ;

    final Set<StudentCurricularPlan> studentCurricularPlans =
        cardGenerationBatch.getStudentCurricularPlans(begin, end, student);
    if (studentCurricularPlans.size() == 1) {
      return studentCurricularPlans.iterator().next();
    } else if (studentCurricularPlans.size() > 1) {
      final StudentCurricularPlan max = findMaxStudentCurricularPlan(studentCurricularPlans);
      return max;
    }
    return null;
  }
 private CardGenerationEntry createEntry(
     final CardGenerationBatch cardGenerationBatch,
     final String identificationId,
     final String line) {
   final CardGenerationEntry cardGenerationEntry =
       cardGenerationBatch.createCardGenerationEntries(line);
   cardGenerationEntry.setDocumentID(identificationId);
   return cardGenerationEntry;
 }
 private boolean isInValidTimeFrame(final CardGenerationEntry cardGenerationEntry) {
   final CardGenerationBatch cardGenerationBatch = cardGenerationEntry.getCardGenerationBatch();
   final ExecutionYear executionYear = cardGenerationBatch.getExecutionYear();
   return isInValidTimeFrame(executionYear);
 }