ClientIterator iterator = (ClientIterator) styleHandle .clientsIterator( );
Iterator iterator = styleHandle.clientsIterator( );
	public void testStyle( ) throws Exception	{		// an element with a shared style.		DesignElementHandle handle = designHandle.findElement( "bodyLabel1" ); //$NON-NLS-1$		SharedStyleHandle styleHandle = handle.getStyle( );		assertNotNull( styleHandle );		PrivateStyleHandle privateStyleHandle = (PrivateStyleHandle) handle				.getPrivateStyle( );		assertNotNull( privateStyleHandle );		assertEquals( "bodyLabel1", privateStyleHandle.getName( ) ); //$NON-NLS-1$		assertEquals( "Style1", styleHandle.getName( ) ); //$NON-NLS-1$		// an element without a style.		handle = designHandle.findElement( "bodyLabel2" ); //$NON-NLS-1$		styleHandle = handle.getStyle( );		assertNull( styleHandle );		privateStyleHandle = (PrivateStyleHandle) handle.getPrivateStyle( );		assertNotNull( privateStyleHandle );		assertEquals( "bodyLabel2", privateStyleHandle.getName( ) ); //$NON-NLS-1$		// an element with a private style.		handle = designHandle.findElement( "bodyLabel3" ); //$NON-NLS-1$		styleHandle = handle.getStyle( );		assertNull( styleHandle );		privateStyleHandle = (PrivateStyleHandle) handle.getPrivateStyle( );		assertNotNull( privateStyleHandle );		assertEquals( "bodyLabel3", privateStyleHandle.getName( ) ); //$NON-NLS-1$		// sets a shared style for bodyLabel3 by the style name.		styleHandle = designHandle.findStyle( "Style1" ); //$NON-NLS-1$				handle.setStyleName( styleHandle.getName( ) );		assertNotNull( handle.getStyle( ) );		// clears the style		handle.setStyle( null );		assertNull( handle.getStyle( ) );		// resets the style on the label		styleHandle = designHandle.findStyle( "My Style" ); //$NON-NLS-1$			handle.setStyle( styleHandle );		assertNotNull( handle.getStyle( ) );		assertEquals( "My Style", handle.getStyle( ).getName( ) ); //$NON-NLS-1$		// clears the style		handle.setStyleElement( null );		assertNull( handle.getStyle( ) );		// resets the style on the label		styleHandle = designHandle.findStyle( "Style1" ); //$NON-NLS-1$			handle.setStyle( styleHandle );		assertNotNull( handle.getStyle( ) );		assertEquals( "Style1", handle.getStyle( ).getName( ) ); //$NON-NLS-1$			// clears the style		handle.setStyleElement( null );		assertNull( handle.getStyle( ) );		// resets the style through another label.		try		{			handle.setStyleElement( new Style( "unknownStyle" ) ); //$NON-NLS-1$			fail( );		}		catch ( StyleException e )		{			assertEquals( StyleException.DESIGN_EXCEPTION_NOT_FOUND, e					.getErrorCode( ) );		}		handle.setName( "newLabel" ); //$NON-NLS-1$		assertEquals( "newLabel", handle.getName( ) ); //$NON-NLS-1$		// font family property has choices, and the number of choices is 5.		IChoice[] choices = styleHandle.getChoices( Style.FONT_FAMILY_PROP );		assertNotNull( choices );		assertEquals( 5, choices.length );		// master page property has choices.		choices = styleHandle.getChoices( Style.MASTER_PAGE_PROP );		assertNull( choices );		// style1 has 2 clients.		ClientIterator iterator = (ClientIterator) styleHandle				.clientsIterator( );		int count = 0;		for ( ; iterator.hasNext( ); iterator.next( ) )			count++;		assertEquals( 2, count );		DerivedElementIterator iteratorDerived = (DerivedElementIterator) styleHandle				.derivedIterator( );		count = 0;		for ( ; iteratorDerived.hasNext( ); iteratorDerived.next( ) )			count++;		assertEquals( 0, count );	}