QueryPlannerUtils { public static AnalyticsAggregationType getAggregationType( AnalyticsAggregationType aggregationType, ValueType valueType, PeriodType aggregationPeriodType, PeriodType dataPeriodType ) { DataType dataType = DataType.fromValueType( valueType ); boolean disaggregation = isDisaggregation( aggregationType, aggregationPeriodType, dataPeriodType ); return new AnalyticsAggregationType( aggregationType.getAggregationType(), aggregationType.getPeriodAggregationType(), dataType, disaggregation ); }  static ListMap<Integer, DimensionalItemObject> getLevelOrgUnitMap( List<DimensionalItemObject> orgUnits ); static ListMap<Integer, OrganisationUnit> getLevelOrgUnitTypedMap( List<OrganisationUnit> orgUnits ); static ListMap<DataType, DimensionalItemObject> getDataTypeDataElementMap( List<DimensionalItemObject> dataElements ); static ListMap<AnalyticsAggregationType, DimensionalItemObject> getAggregationTypeDataElementMap(
        List<DimensionalItemObject> dataElements, AnalyticsAggregationType aggregationType, String periodType ); static ListMap<Integer, DimensionalItemObject> getDaysPeriodMap( List<DimensionalItemObject> periods ); static AnalyticsAggregationType getAggregationType( AnalyticsAggregationType aggregationType, ValueType valueType,
        PeriodType aggregationPeriodType, PeriodType dataPeriodType ); static boolean isDisaggregation( AnalyticsAggregationType aggregationType, PeriodType aggregationPeriodType, PeriodType dataPeriodType ); static ListMap<PeriodType, DimensionalItemObject> getPeriodTypeDataElementMap(
        Collection<DimensionalItemObject> dataElements ); static List<EventQueryParams> convert( List<DataQueryParams> params );  }
@Test public void testGetAggregationType() { AnalyticsAggregationType typeA = new AnalyticsAggregationType( AggregationType.SUM, AggregationType.AVERAGE, DataType.NUMERIC, true ); AnalyticsAggregationType typeB = new AnalyticsAggregationType( AggregationType.AVERAGE, AggregationType.AVERAGE, DataType.NUMERIC, true ); assertEquals( typeA, QueryPlannerUtils.getAggregationType( new AnalyticsAggregationType( AggregationType.SUM, AggregationType.AVERAGE ), ValueType.INTEGER, new QuarterlyPeriodType(), new YearlyPeriodType() ) ); assertEquals( typeB, QueryPlannerUtils.getAggregationType( new AnalyticsAggregationType( AggregationType.AVERAGE, AggregationType.AVERAGE ), ValueType.INTEGER, new QuarterlyPeriodType(), new YearlyPeriodType() ) ); }