private FormEntryPrompt findQuestion(
      FormEntryController formEntryContorller, TreeReference treeReferenceToMatch) {
    formEntryContorller.jumpToIndex(FormIndex.createBeginningOfFormIndex());
    int event;
    while ((event = formEntryContorller.stepToNextEvent())
        != FormEntryController.EVENT_END_OF_FORM) {
      if (event == FormEntryController.EVENT_QUESTION) {
        FormEntryPrompt questionPrompt = formEntryContorller.getModel().getQuestionPrompt();
        QuestionDef thisQuestionDef = questionPrompt.getQuestion();
        TreeReference thisTreeReference = (TreeReference) thisQuestionDef.getBind().getReference();
        if (thisTreeReference.equals(treeReferenceToMatch)) return questionPrompt;
      }
    }

    return null;
  }