@Test public void testRemoveElement() { CrosstabOtherGroup group = mock( CrosstabOtherGroup.class ); CrosstabOtherGroupBody body = new CrosstabOtherGroupBody(); body.setGroup( group ); body.removeElement( group ); assertThat( group.getParentSection(), is( nullValue() ) ); assertThat( body.getGroup(), is( not( equalTo( group ) ) ) ); assertThat( (CrosstabOtherGroupBody) body.getGroup().getParentSection(), is( equalTo( body ) ) ); }
protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( element == group ) { this.group.setParent( null ); this.group = new CrosstabOtherGroup(); this.group.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.group ); } }
CrosstabOtherGroupBody extends GroupBody { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( element == group ) { this.group.setParent( null ); this.group = new CrosstabOtherGroup(); this.group.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.group ); } } }
CrosstabOtherGroupBody extends GroupBody { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( element == group ) { this.group.setParent( null ); this.group = new CrosstabOtherGroup(); this.group.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.group ); } } CrosstabOtherGroupBody();  CrosstabOtherGroupBody( final CrosstabOtherGroup group ); }
CrosstabOtherGroupBody extends GroupBody { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( element == group ) { this.group.setParent( null ); this.group = new CrosstabOtherGroup(); this.group.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.group ); } } CrosstabOtherGroupBody();  CrosstabOtherGroupBody( final CrosstabOtherGroup group ); CrosstabOtherGroup getGroup(); void setGroup( final CrosstabOtherGroup group ); void setElementAt( final int position, final Element element ); int getElementCount(); Element getElement( final int index ); CrosstabOtherGroupBody clone(); CrosstabOtherGroupBody derive( final boolean preserveElementInstanceIds ); }
CrosstabOtherGroupBody extends GroupBody { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( element == group ) { this.group.setParent( null ); this.group = new CrosstabOtherGroup(); this.group.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.group ); } } CrosstabOtherGroupBody();  CrosstabOtherGroupBody( final CrosstabOtherGroup group ); CrosstabOtherGroup getGroup(); void setGroup( final CrosstabOtherGroup group ); void setElementAt( final int position, final Element element ); int getElementCount(); Element getElement( final int index ); CrosstabOtherGroupBody clone(); CrosstabOtherGroupBody derive( final boolean preserveElementInstanceIds );  }