class DashboardItemDeletionHandler extends DeletionHandler {

    @Override
    public void deleteDocument( Document document )
    {
        for ( DashboardItem item : dashboardService.getDocumentDashboardItems( document ) )
        {
            while ( item.getResources().contains( document ) ) // In case of duplicates
            {
                item.getResources().remove( document );
            }

            if ( item.getResources().isEmpty() )
            {
                dashboardService.deleteDashboardItem( item );
            }
        }
    }

    public  DashboardItemDeletionHandler( DashboardService dashboardService );

}