@Test
public void testRemoveElement() {
ItemBand itemBand = mock( ItemBand.class );
NoDataBand band = mock( NoDataBand.class );
DetailsHeader header = mock( DetailsHeader.class );
DetailsFooter footer = mock( DetailsFooter.class );
body.setItemBand( itemBand );
body.setNoDataBand( band );
body.setDetailsHeader( header );
body.setDetailsFooter( footer );
body.removeElement( itemBand );
assertThat( itemBand.getParentSection(), is( nullValue() ) );
assertThat( body.getItemBand(), is( not( equalTo( itemBand ) ) ) );
assertThat( (GroupDataBody) body.getItemBand().getParentSection(), is( equalTo( body ) ) );
body.removeElement( band );
assertThat( band.getParentSection(), is( nullValue() ) );
assertThat( body.getNoDataBand(), is( not( equalTo( band ) ) ) );
assertThat( (GroupDataBody) body.getNoDataBand().getParentSection(), is( equalTo( body ) ) );
body.removeElement( header );
assertThat( header.getParentSection(), is( nullValue() ) );
assertThat( body.getDetailsHeader(), is( not( equalTo( header ) ) ) );
assertThat( (GroupDataBody) body.getDetailsHeader().getParentSection(), is( equalTo( body ) ) );
body.removeElement( footer );
assertThat( footer.getParentSection(), is( nullValue() ) );
assertThat( body.getDetailsFooter(), is( not( equalTo( footer ) ) ) );
assertThat( (GroupDataBody) body.getDetailsFooter().getParentSection(), is( equalTo( body ) ) );
}