@Test
public void testGetListMapValueMapper()
{

    DataElementGroupSet groupSetA = new DataElementGroupSet( "GroupSetA" );
    DataElementGroupSet groupSetB = new DataElementGroupSet( "GroupSetB" );
    DataElementGroupSet groupSetC = new DataElementGroupSet( "GroupSetC" );
    DataElementGroupSet groupSetZ = new DataElementGroupSet( "GroupSetZ" );
    
    DataElementGroup groupA = new DataElementGroup( "GroupA" );
    DataElementGroup groupB = new DataElementGroup( "GroupB" );
    DataElementGroup groupC = new DataElementGroup( "GroupC" );
    DataElementGroup groupD = new DataElementGroup( "GroupD" );
    DataElementGroup groupE = new DataElementGroup( "GroupE" );
    DataElementGroup groupF = new DataElementGroup( "GroupF" );
    
    groupA.getGroupSets().add( groupSetA );
    groupB.getGroupSets().add( groupSetB );
    groupC.getGroupSets().add( groupSetC );
    groupD.getGroupSets().add( groupSetA );
    groupE.getGroupSets().add( groupSetB );
    groupF.getGroupSets().add( groupSetA );
    
    Set<DataElementGroup> groups = Sets.newHashSet( groupA, groupB, groupC, groupD, groupE, groupF );
                    
    SetMap<DataElementGroupSet, DataElementGroup> map = SetMap.getSetMap( groups, group -> group.getGroupSets().iterator().next() );
    
    assertEquals( Sets.newHashSet( groupA, groupD, groupF ), map.get( groupSetA ) );
    assertEquals( Sets.newHashSet( groupB, groupE ), map.get( groupSetB ) );
    assertEquals( Sets.newHashSet( groupC ), map.get( groupSetC ) );
    assertNull( map.get( groupSetZ ) );
}