@Override
  public void removeItem( TreeItem item )
  {
    // Validate.
    if ( children == null )
    {
      return;
    }
    else if ( !children.contains( item ) )
    {
      for ( TreeItem child : children )
      {
        child.removeItem( item );
      }
      return;
    }
    // Orphan.
    Tree oldTree = tree;
    item.setTree( null );

    // Physical detach.
    if ( root )
    {
      oldTree.getElement().removeChild( item.getElement() );
    }
    else
    {
      childSpanElement.removeChild( item.getElement() );
    }

    // Logical detach.
    item.setParent( null );
    children.remove( item );

    if ( !root && children.size() == 0 )
    {
      setState( false, false );
    }
  }