NaryTreeNode extends AbstractTreeNode<D, N> { @Override @SuppressWarnings("checkstyle:npathcomplexity") public boolean setChildAt(int index, N newChild) throws IndexOutOfBoundsException { final int count = (this.children == null) ? 0 : this.children.size(); if (index < 0 || index >= count) { throw new IndexOutOfBoundsException(); } final N oldChild = this.children.get(index); if (oldChild == newChild) { return false; } if (oldChild != null) { oldChild.setParentNodeReference(null, true); --this.notNullChildCount; firePropertyChildRemoved(index, oldChild); } if (newChild != null) { final N oldParent = newChild.getParentNode(); if (oldParent != this) { newChild.removeFromParent(); } } if (newChild != null) { this.children.set(index, newChild); } else { this.children.remove(index); } if (newChild != null) { newChild.setParentNodeReference(toN(), true); ++this.notNullChildCount; firePropertyChildAdded(index, newChild); } return true; } NaryTreeNode();  NaryTreeNode(Collection<D> data);  NaryTreeNode(D data);  NaryTreeNode(boolean useLinkedList);  NaryTreeNode(boolean useLinkedList, boolean copyDataCollection, List<D> data);  NaryTreeNode(boolean useLinkedList, D data); @Pure @Override Class<? extends Enum<?>> getPartitionEnumeration(); @Override void clear(); @Pure @Override final int getChildCount(); @Pure @Override int getNotNullChildCount(); @Pure @Override final int indexOf(N child); @Pure @Override final N getChildAt(int index); boolean moveTo(N newParent); @Override boolean moveTo(N newParent, int index); @Override @SuppressWarnings("checkstyle:npathcomplexity") boolean setChildAt(int index, N newChild); @Override final boolean removeChild(N child); final boolean addChild(N child); final boolean addChild(int index, N newChild); @Pure @Override final boolean isLeaf(); @Override void getChildren(Object[] array); @Pure @Override int getMinHeight(); @Pure @Override int getMaxHeight();  }
@Test public void setChildAt_newNode_1() { try { this.node.setChildAt(1, this.newNode); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }
@Test public void setChildAt_newNode_2() { try { this.node.setChildAt(2, this.newNode); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }
@Test public void setChildAt_moveNode_m1() { try { this.node.setChildAt(-1, this.child2); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }
@Test public void setChildAt_moveNode_0() { try { this.node.setChildAt(0, this.child2); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }
@Test public void setChildAt_moveNode_1() { try { this.node.setChildAt(1, this.child2); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }
@Test public void setChildAt_moveNode_2() { try { this.node.setChildAt(2, this.child2); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }
@Test public void setChildAt_newNode_m1() { try { this.node.setChildAt(-1, this.newNode); fail("expecting IndexOutOfBoundsException"); } catch( IndexOutOfBoundsException e) { } }
@Test public void setChildAt_newNode_0() { try { this.node.setChildAt(0, this.newNode); fail("expecting IndexOutOfBoundsException"); } catch(IndexOutOfBoundsException e) { } }