### Question:
GeoRole extends XulEventSourceAdapter implements DataRole, Serializable, IMemberAnnotation,
    IDataRoleAnnotation, IGeoRoleAnnotation { public boolean evaluate( String fieldName ) { if ( commonAliases == null || fieldName == null || fieldName.length() == 0 ) { return false; } for ( String alias : commonAliases ) { String testName = fieldName.toLowerCase(); String testAlias = alias.toLowerCase(); if ( eval( testName, testAlias ) ) { return true; } else if ( eval( testName, testAlias.replaceAll( " ", "" ) ) ) { return true; } else if ( eval( testName, testAlias.replaceAll( " ", getMatchSeparator() ) ) ) { return true; } } return false; } GeoRole();  GeoRole( String name, List<String> commonAliases );  GeoRole( String name, String commonAliases );  GeoRole( String name, String displayName, String commonAliases ); @Bindable String getName(); @Bindable void setName( String name ); @Bindable String getDisplayName(); @Bindable void setDisplayName( String displayName ); List<String> getCommonAliases(); void setCommonAliases( List<String> commonAliases ); String getMatchSeparator(); void setMatchSeparator( String matchSeparator ); boolean evaluate( String fieldName ); @Override boolean equals( Object o ); @Override int hashCode(); GeoRole clone(); void setRequiredParentRoles( List<GeoRole> parentRoles ); List<GeoRole> getRequiredParentRoles(); @Override void saveAnnotations( OlapHierarchyLevel level ); boolean hasAnnotation( String name, OlapHierarchyLevel level ); @Override String getDataType(); @Override String getGeoName(); @Override boolean isValid( AbstractMetaDataModelNode node ); @Override List<String> getValidationMessages( AbstractMetaDataModelNode node ); void onAttach( AbstractMetaDataModelNode node ); void onDetach( AbstractMetaDataModelNode node ); static final String ANNOTATTION_GEO_VALUE; }### Answer:
@Test public void testEvaluation() { String[] aliases = { "st", "state", "province", "stateProvince", "postal code" }; GeoRole state = new GeoRole( "State", Arrays.asList( aliases ) ); assertTrue( state.evaluate( "STATE" ) ); assertTrue( state.evaluate( "province" ) ); assertTrue( state.evaluate( "st" ) ); assertTrue( state.evaluate( "StateProvince" ) ); assertTrue( state.evaluate( "postalcode" ) ); assertTrue( state.evaluate( "POSTALCODE" ) ); assertTrue( state.evaluate( "postal_code" ) ); assertTrue( state.evaluate( "postal code" ) ); assertEquals( false, state.evaluate( "sta" ) ); assertEquals( false, state.evaluate( "prov" ) ); assertEquals( false, state.evaluate( "provinc" ) ); assertEquals( false, state.evaluate( "past" ) ); }