@Test
public void testGenerateEventDataPermutations()
{

    Map<String, List<EventAnalyticsDimensionalItem>> tableRows = new LinkedHashMap<>();
    Grid grid = new ListGrid( );
    DataElement deA = createDataElement( 'A' );
    deA.setValueType( ValueType.BOOLEAN );
    grid.addMetaData( deA.getUid(), deA );
    TrackedEntityAttribute trackedEntityAttribute = createTrackedEntityAttribute( 'B' );
    OptionSet optionSet = new OptionSet( );
    optionSet.addOption( new Option( "name", "code" ) );
    trackedEntityAttribute.setOptionSet( optionSet );
    grid.addMetaData( trackedEntityAttribute.getUid(), trackedEntityAttribute );
    List<EventAnalyticsDimensionalItem> objects = new ArrayList<>( );
    Option t = new Option();
    t.setCode( "1" );
    t.setName( "Yes" );
    Option f = new Option();
    f.setCode( "0" );
    f.setName( "No" );
    objects.add( new EventAnalyticsDimensionalItem( t, deA.getUid() ) );
    objects.add( new EventAnalyticsDimensionalItem( f, deA.getUid() ) );
    objects.add( new EventAnalyticsDimensionalItem( new Option( "name", "code" ), trackedEntityAttribute.getUid() ) );
    tableRows.put( deA.getUid(), objects );
    tableRows.put( trackedEntityAttribute.getDimensionItem(), objects);
    List<Map<String, EventAnalyticsDimensionalItem>> rowPermutations = EventAnalyticsUtils.generateEventDataPermutations( tableRows );
    assertEquals( 9, rowPermutations.size() );
}