protected Long getAnswerId(Integer questionSeqId, List<? extends AnswerHeaderContract> answerHeaders) {
        if (answerHeaders != null && !answerHeaders.isEmpty()) {
            for (AnswerHeaderContract answerHeader : answerHeaders) {
                List<? extends AnswerContract> answerDetails = answerHeader.getAnswers();
                for (AnswerContract answers : answerDetails) {
                    if (answers.getAnswer() != null && questionSeqId.equals(getQuestionAnswerService().findQuestionById(answers.getQuestionId()).getQuestionSeqId())) {
                        return answers.getId();
                    }
                }
            }
        }
        return null;
    }
protected Long getAnswerId ( Integer questionSeqId , List < ? extends AnswerHeaderContract > answerHeaders ) { if ( answerHeaders != null && ! answerHeaders . isEmpty ( ) ) { for ( AnswerHeaderContract answerHeader : answerHeaders ) { List < ? extends AnswerContract > answerDetails = answerHeader . getAnswers ( ) ; for ( AnswerContract answers : answerDetails ) { if ( answers . getAnswer ( ) != null && questionSeqId . equals ( getQuestionAnswerService ( ) . findQuestionById ( answers . getQuestionId ( ) ) . getQuestionSeqId ( ) ) ) { return answers . getId ( ) ; } } } } return null ; }
This method is used to get the answerId for a particular Questionnaire question
question based on the question id.

@param questionSeqId
the question seq id to be passed.
@return returns the answer for a particular
question based on the question id passed.