### Question:
AnnotationType implements Serializable { protected String resolveFieldFromMeasure( final ModelerWorkspace modelerWorkspace, final String measureName, final String cubeName ) throws ModelerException { if ( StringUtils.isBlank( measureName ) || StringUtils.isBlank( cubeName ) || modelerWorkspace == null ) { throw new ModelerException( BaseMessages.getString( "ModelAnnotation.resolveField.UNABLE_TO_FIND_MEASURE", measureName ) ); } String locale = Locale.getDefault().toString(); OlapCube olapCube = getOlapCube( modelerWorkspace, cubeName ); if ( olapCube == null ) { throw new ModelerException( BaseMessages.getString( "ModelAnnotation.resolveField.UNABLE_TO_FIND_CUBE", cubeName ) ); } List measures = olapCube.getOlapMeasures(); for ( int m = 0; m < measures.size(); m++ ) { OlapMeasure measure = (OlapMeasure) measures.get( m ); if ( measureName .equals( "[" + MEASURES_DIMENSION + "].[" + measure.getLogicalColumn().getName( locale ) + "]" ) ) { return (String) measure.getLogicalColumn().getName( locale ); } } throw new ModelerException( BaseMessages.getString( "ModelAnnotation.resolveField.UNABLE_TO_FIND_MEASURE", measureName ) ); }  List<String> getModelPropertyIds(); void setModelPropertyValueById( String id, Object value ); Object getModelPropertyValueById( String id ); Object getModelPropertyValueByName( String name ); Class getModelPropertyNameClassType( String name ); List<String> getModelPropertyNames(); List<ModelProperty> getModelProperties(); void setModelPropertyByName( String modelPropertyName, Object value ); Map<String, Serializable> describe(); void populate( final Map<String, Serializable> propertiesMap ); void iterateProperties( KeyValueClosure closure ); @Override boolean equals( Object obj ); @Override int hashCode(); abstract boolean apply(
      final ModelerWorkspace workspace, final IMetaStore metaStore ); abstract boolean apply( final Document schema ); abstract void validate(); abstract ModelAnnotation.Type getType(); abstract String getSummary(); abstract String getName(); abstract String getField(); boolean equalsLogically( AnnotationType obj );  }### Answer:
@Test public void testResolveFieldFromMeasure() throws Exception { IMetaStore metaStore = new MemoryMetaStore(); ModelerWorkspace model = new ModelerWorkspace( new ModelerWorkspaceHelper( "" ) ); model.setDomain( new XmiParser().parseXmi( new FileInputStream( PRODUCT_XMI_FILE ) ) ); model.getWorkspaceHelper().populateDomain( model ); CreateMeasure createMeasure = new CreateMeasure(); createMeasure.setAggregateType( MINIMUM ); createMeasure.setName( "Min Buy Price" ); createMeasure.setFormatString( "##.##" ); createMeasure.setMeasure( "[Measures].[bc_BUYPRICE]" ); createMeasure.setCube( "products_38GA" ); createMeasure.apply( model, metaStore ); assertEquals( "bc_BUYPRICE", createMeasure.getField() ); }