### Question:
TreeModelSupport { public void fireTreeStructureChanged(TreePath subTreePath) { if (subTreePath != null) { Contract.asNotNull(subTreePath.getPath(), "path must not contain null elements"); } Object[] pairs = listeners.getListenerList(); TreeModelEvent e = null; for (int i = pairs.length - 2; i >= 0; i -= 2) { if (pairs[i] == TreeModelListener.class) { if (e == null) e = createStructureChangedEvent(subTreePath); ((TreeModelListener) pairs[i + 1]).treeStructureChanged(e); } } } TreeModelSupport(TreeModel model); void fireNewRoot(); void firePathLeafStateChanged(TreePath path); void fireTreeStructureChanged(TreePath subTreePath); void firePathChanged(TreePath path); void fireChildChanged(TreePath parentPath, int index, Object child); void fireChildrenChanged(TreePath parentPath, int[] indices,
            Object[] children); void fireChildAdded(TreePath parentPath, int index, Object child); void fireChildRemoved(TreePath parentPath, int index, Object child); void fireChildrenAdded(TreePath parentPath, int[] indices,
            Object[] children); void fireChildrenRemoved(TreePath parentPath, int[] indices,
            Object[] children); void addTreeModelListener(TreeModelListener l); TreeModelListener[] getTreeModelListeners(); void removeTreeModelListener(TreeModelListener l);  }### Answer:
@Test public void testTreeStructureChangedNullPath() { support.fireTreeStructureChanged( null ); assertEquals( 1, report.getEventCount() ); assertEquals( 1, report.getStructureEventCount() ); final TreeModelEvent structureEvent = report.getLastStructureEvent(); assertNull( structureEvent.getChildren() ); assertNull( structureEvent.getTreePath() ); assertNull( structureEvent.getPath() ); }
@Test( expected = IllegalArgumentException.class ) public void testTreeStructureChangedNotNullPathElements() { final TreePath path = new TreePath( new Object[]{ null } ); support.fireTreeStructureChanged( path ); }
@Test public void testTreeStructureChangedNotNullPath() { final Object root = model.getRoot(); final Object child = model.getChild( root, 0 ); final TreePath path = new TreePath( new Object[]{ root, child } ); support.fireTreeStructureChanged( path ); assertEquals( 1, report.getEventCount() ); assertEquals( 1, report.getStructureEventCount() ); final TreeModelEvent structureEvent = report.getLastStructureEvent(); assertEquals( path, structureEvent.getTreePath() ); }