EventAnalyticsUtils { public static Map<String, Object> getAggregatedEventDataMapping( Grid grid ) { Map<String, Object> map = new HashMap<>(); int metaCols = grid.getWidth() - 1; int valueIndex = grid.getWidth() - 1; for ( List<Object> row : grid.getRows() ) { List<String> ids = new ArrayList<>(); for ( int index = 0; index < metaCols; index++ ) { Object id = row.get( index ); if ( id != null ) { ids.add( (String) row.get( index ) ); } } Collections.sort( ids ); String key = StringUtils.join( ids, DIMENSION_SEP ); Object value = row.get( valueIndex ); map.put( key, value ); } return map; }  static void recurse( Map<String, List<EventAnalyticsDimensionalItem>> map, ListIterator<String> iter,
        TreeMap<String, EventAnalyticsDimensionalItem> cur, List<Map<String, EventAnalyticsDimensionalItem>> list ); static List<Map<String, EventAnalyticsDimensionalItem>> generateEventDataPermutations(
        Map<String, List<EventAnalyticsDimensionalItem>> dataOptionMap ); static Map<String, Object> getAggregatedEventDataMapping( Grid grid ); static void addValues( List<List<String>> ids, Grid grid, Grid outputGrid );  }
@Test public void testGetAggregatedDataValueMapping() { Grid grid = new ListGrid(); grid.addRow(); grid.addValue( "de1" ); grid.addValue( "ou2" ); grid.addValue( "pe1" ); grid.addValue( 3 ); grid.addRow(); grid.addValue( "de2" ); grid.addValue( "ou3" ); grid.addValue( "pe2" ); grid.addValue( 5 ); Map<String, Object> map = EventAnalyticsUtils.getAggregatedEventDataMapping( grid ); assertEquals( 3, map.get( "de1" + DIMENSION_SEP + "ou2" + DIMENSION_SEP + "pe1" ) ); assertEquals( 5, map.get( "de2" + DIMENSION_SEP + "ou3" + DIMENSION_SEP + "pe2" ) ); }