@Test
public void testGetAvailableItemByType()
{

    Dashboard dashboard = new Dashboard();
    
    DashboardItem diA = new DashboardItem();
    DashboardItem diB = new DashboardItem();
    DashboardItem diC = new DashboardItem();
    
    diA.setUid( "A" );
    diB.setUid( "B" );
    diC.setUid( "C" );
    
    diA.setVisualization( new Visualization ( "A" ) );
    diB.getReports().add( new Report( "A", null, null, new Visualization() ) );
    diB.getReports().add( new Report( "B", null, null, new Visualization() ) );
    diC.getResources().add( new Document( "A", null, false, null ) );
    diC.getResources().add( new Document( "B", null, false, null ) );
    diC.getResources().add( new Document( "C", null, false, null ) );
    
    dashboard.getItems().add( diA );
    dashboard.getItems().add( diB );
    dashboard.getItems().add( diC );
    
    assertEquals( diB, dashboard.getAvailableItemByType( DashboardItemType.REPORTS ) );
    assertEquals( diC, dashboard.getAvailableItemByType( DashboardItemType.RESOURCES ) );
    assertNull( dashboard.getAvailableItemByType( DashboardItemType.MAP ) );
}