@Test
public void testGetIdMap()
{

    DataElement deA = new DataElement( "NameA" );
    DataElement deB = new DataElement( "NameB" );
    DataElement deC = new DataElement( "NameC" );
    
    deA.setCode( "CodeA" );
    deB.setCode( "CodeB" );
    deC.setCode( "CodeC" );
    
    deA.setUid( "A123456789A" );
    deB.setUid( "A123456789B" );
    deC.setUid( "A123456789C" );
    
    List<DataElement> elements = Lists.newArrayList( deA, deB, deC );
    
    Map<String, DataElement> map = IdentifiableObjectUtils.getIdMap( elements, IdScheme.from( IdentifiableProperty.NAME ) );
    
    assertEquals( deA, map.get( "NameA" ) );
    assertEquals( deB, map.get( "NameB" ) );
    assertEquals( deC, map.get( "NameC" ) );
    assertNull( map.get( "NameD" ) );
    map = IdentifiableObjectUtils.getIdMap( elements, IdScheme.from( IdentifiableProperty.UID ) );
    
    assertEquals( deA, map.get( "A123456789A" ) );
    assertEquals( deB, map.get( "A123456789B" ) );
    assertEquals( deC, map.get( "A123456789C" ) );
    assertNull( map.get( "A123456789D" ) );
    
    map = IdentifiableObjectUtils.getIdMap( elements, IdScheme.from( IdentifiableProperty.CODE ) );
    
    assertEquals( deA, map.get( "CodeA" ) );
    assertEquals( deB, map.get( "CodeB" ) );
    assertEquals( deC, map.get( "CodeC" ) );
    assertNull( map.get( "CodeD" ) );
}