@Test
public void when_getNestingForm_is_provided_with_component_which_has_form_ancestor_then_it_is_returned() {

    // given
    UIComponent form = mock(UIForm.class);
    UIComponent component1 = mock(UIComponent.class);
    UIComponent component2 = mock(UIComponent.class);
    when(component1.getParent()).thenReturn(component2);
    when(component2.getParent()).thenReturn(form);
    // when
    UIComponent result = utils.getNestingForm(component1);
    // then
    assertEquals(form, result);
}