@Test
public void testRemoveQuestionFromSection() {

    QuestionGroupForm questionGroup = new QuestionGroupForm();
    List<SectionDetailForm> sections = new ArrayList<SectionDetailForm>();
    sections.add(getSectionSectionDetailForm("sectionName", new ArrayList<SectionQuestionDetail>(asList(getSectionQuestionDetail(1, "Q1"), getSectionQuestionDetail(2, "Q2")))));
    questionGroup.setSections(sections);
    assertThat(questionGroup.getSections().size(), CoreMatchers.is(1));
    assertThat(questionGroup.getSections().get(0).getSectionQuestions().size(), CoreMatchers.is(2));
    assertThat(questionGroup.getSections().get(0).getSectionQuestions().get(0).getText(), CoreMatchers.is("Q1"));
    assertThat(questionGroup.getSections().get(0).getSectionQuestions().get(1).getText(), CoreMatchers.is("Q2"));
    questionGroupController.deleteQuestion(questionGroup, "sectionName", "1");
    assertThat(questionGroup.getSections().size(), CoreMatchers.is(1));
    assertThat(questionGroup.getSections().get(0).getSectionQuestions().size(), CoreMatchers.is(1));
    assertThat(questionGroup.getSections().get(0).getSectionQuestions().get(0).getText(), CoreMatchers.is("Q2"));
    questionGroupController.deleteQuestion(questionGroup, "sectionName", "2");
    assertThat(questionGroup.getSections().size(), CoreMatchers.is(0));
}