List sibsPaymentFileEntryList = SibsPaymentFileEntry.readByYearAndStudentNumberAndPaymentType( sibsPaymentFileEntry.getYear(), sibsPaymentFileEntry.getStudentNumber(), sibsPaymentFileEntry.getPaymentType());
List sibsPaymentFileEntryList = SibsPaymentFileEntry .readByYearAndStudentNumberAndPaymentTypeExceptFileEntry(sibsPaymentFileEntry);
    private void markDuplicateGratuityAndInsurancePayments(SibsPaymentFileEntry sibsPaymentFileEntry,            List sibsPaymentFileEntries, int totalPaymentEntries, int currentIndex)            throws ExcepcaoPersistencia {        // first check if the gratuity or insurance payment is repeated inside        // the file        for (int j = currentIndex + 1; j < totalPaymentEntries; j++) {            SibsPaymentFileEntry duplicatePaymentCandidate = (SibsPaymentFileEntry) sibsPaymentFileEntries                    .get(j);            if (sibsPaymentFileEntry.getYear().equals(duplicatePaymentCandidate.getYear())                    && sibsPaymentFileEntry.getStudentNumber().equals(                            duplicatePaymentCandidate.getStudentNumber())                    && sibsPaymentFileEntry.getPaymentType().equals(                            duplicatePaymentCandidate.getPaymentType())) {                if (sibsPaymentFileEntry.getPaymentType().equals(SibsPaymentType.INSURANCE)) {                    sibsPaymentFileEntry.setPaymentStatus(SibsPaymentStatus.DUPLICATE_INSURANCE_PAYMENT);                } else {                    sibsPaymentFileEntry.setPaymentStatus(SibsPaymentStatus.DUPLICATE_GRATUITY_PAYMENT);                }            }        }        if (sibsPaymentFileEntry.getPaymentStatus()                .equals(SibsPaymentStatus.DUPLICATE_INSURANCE_PAYMENT)                || sibsPaymentFileEntry.getPaymentStatus().equals(                        SibsPaymentStatus.DUPLICATE_GRATUITY_PAYMENT)) {            // the entry is already marked            return;        }        // next check if the gratuity or insurance payment is repeated in        // database        List sibsPaymentFileEntryList = SibsPaymentFileEntry.readByYearAndStudentNumberAndPaymentType(                sibsPaymentFileEntry.getYear(), sibsPaymentFileEntry.getStudentNumber(),                sibsPaymentFileEntry.getPaymentType());        if (sibsPaymentFileEntryList.size() > 0) {            if (sibsPaymentFileEntry.getPaymentType().equals(SibsPaymentType.INSURANCE)) {                sibsPaymentFileEntry.setPaymentStatus(SibsPaymentStatus.DUPLICATE_INSURANCE_PAYMENT);            } else {                sibsPaymentFileEntry.setPaymentStatus(SibsPaymentStatus.DUPLICATE_GRATUITY_PAYMENT);            }        }    }