assertThat( menus.getItems().get( 0 ) ).isInstanceOf( MenuGroup.class );
assertThat( menus.getItems().get( 0 ).getCaption() ).isEqualTo( "File" );
assertThat( ((MenuGroup) menus.getItems().get( 0 )).getItems() ).hasSize( 1 );
{
final MenuItem menuItem = ((MenuGroup) menus.getItems().get( 0 )).getItems().get( 0 );
assertThat( menuItem ).isNotNull();
assertThat( menuItem.getCaption() ).isEqualTo( "Operations" );
assertThat( menuItem ).isInstanceOf( MenuGroup.class );
{
final MenuItem subMenuItem = ((MenuGroup) menuItem).getItems().get( 0 );
assertThat( subMenuItem ).isNotNull();
assertThat( subMenuItem.getCaption() ).isEqualTo( "Save" );
}
{
final MenuItem subMenuItem = ((MenuGroup) menuItem).getItems().get( 1 );
assertThat( subMenuItem ).isNotNull();
assertThat( subMenuItem.getCaption() ).isEqualTo( "Close" );
}
}
assertThat( menus.getItems().get( 1 ) ).isNotNull();
assertThat( menus.getItems().get( 1 ) ).isInstanceOf( MenuItemCommand.class );