PropertyHandle handle = (PropertyHandle)propIter.next( ); if( "prop1".equals( handle.getDefn( ).getName( ) )); userPropHandle = handle;
GroupPropertyHandle handle = (GroupPropertyHandle) propIter.next( ); if ( "prop1".equals( handle.getPropertyDefn( ).getName( ) ) ); userPropHandle = handle;
	public void test_117648( ) throws UserPropertyException	{		DesignEngine engine = new DesignEngine( new DesignConfig( ) );		SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH );		ReportDesignHandle designHandle = session.createDesign( );		ElementFactory factory = designHandle.getElementFactory( );		LabelHandle label = factory.newLabel( "label" ); //$NON-NLS-1$		UserPropertyDefn userProp = new UserPropertyDefn( );		userProp.setName( "prop1" ); //$NON-NLS-1$		userProp.setType( new StringPropertyType( ) );		userProp.setDefault( "default value" ); //$NON-NLS-1$		label.addUserPropertyDefn( userProp );				// TODO: change to GroupElementHandle and GroupPropertyHandle.				// retrieve all property definitions.		Iterator propIter = label.getPropertyIterator( );		PropertyHandle userPropHandle = null;		while ( propIter.hasNext( ) )		{			PropertyHandle handle = (PropertyHandle)propIter.next( );			if( "prop1".equals( handle.getDefn( ).getName( ) )); //$NON-NLS-1$				userPropHandle = handle;		}		assertNotNull( userPropHandle );		assertEquals( "prop1", userPropHandle.getDefn( ).getName( ) ); //$NON-NLS-1$		assertEquals( PropertyType.STRING_TYPE, userPropHandle.getDefn( ).getTypeCode( ) );		assertEquals( "default value", userPropHandle.getDefn( ).getDefault( ) ); //$NON-NLS-1$	}