### Question:
GeoContext extends AbstractModelList<GeoRole> { public GeoRole matchFieldToGeoRole( AvailableField field ) { for ( GeoRole role : this ) { if ( role.evaluate( field.getPhysicalColumn().getId() ) ) { return role; } else if ( field.getPhysicalColumn().getId().startsWith( "pc__" ) ) { if ( role.evaluate( field.getPhysicalColumn().getId().substring( 4 ) ) ) { return role; } } } return null; } GeoContext(); GeoRole getGeoRole( int index ); void addGeoRole( GeoRole geoRole ); String getDimensionName(); void setDimensionName( String dimensionName ); GeoRole matchFieldToGeoRole( AvailableField field ); GeoRole matchColumnToGeoRole( IPhysicalColumn column ); List<DimensionMetaData> buildDimensions( ModelerWorkspace workspace ); LocationRole getLocationRole(); GeoRole getGeoRoleByName( String name ); void setLocationFields( ModelerWorkspace workspace, LevelMetaData locationLevel ); void setLocationFields( ModelerWorkspace workspace, LevelMetaData locationLevel,
                                 String latitudeFieldName, String longitudeFieldName ); static final String LATITUDE; static final String LONGITUDE; static final String ANNOTATION_DATA_ROLE; static final String ANNOTATION_GEO_ROLE; static final String ANNOTATION_GEO_PARENTS; }### Answer:
@Test public void testMatchingAliasToRole_prefixedPhysicalColumn() throws Exception { GeoContext geo = GeoContextFactory.create( config ); IPhysicalColumn mockStateCol = createMock( IPhysicalColumn.class ); expect( mockStateCol.getId() ).andReturn( "pc__STATE" ).anyTimes(); expect( mockStateCol.getName( LOCALE ) ).andReturn( "State" ).anyTimes(); expect( mockStateCol.getName( "en-US" ) ).andReturn( "State" ).anyTimes(); IPhysicalColumn mockLatCol = createMock( IPhysicalColumn.class ); expect( mockLatCol.getId() ).andReturn( "pc__CUSTOMER_LATITUDE" ).anyTimes(); expect( mockLatCol.getName( LOCALE ) ).andReturn( "Customer_Latitude" ).anyTimes(); expect( mockLatCol.getName( "en-US" ) ).andReturn( "Customer_Latitude" ).anyTimes(); replay( mockStateCol ); replay( mockLatCol ); AvailableField field = new AvailableField( mockStateCol ); GeoRole geoRole = geo.matchFieldToGeoRole( field ); assertNotNull( geoRole ); assertEquals( "state", geoRole.getName() ); field = new AvailableField( mockLatCol ); geoRole = geo.matchFieldToGeoRole( field ); assertNotNull( geoRole ); assertEquals( "location", geoRole.getName() ); }