@Test
public void testPruneToDimensionType()
{

    DataQueryParams params = DataQueryParams.newBuilder()
        .addDimension( new BaseDimensionalObject( DimensionalObject.DATA_X_DIM_ID, DimensionType.DATA_X, null, null,
            Lists.newArrayList( createIndicator( 'A', null ), createIndicator( 'B', null ) ) ) )
        .addDimension( new BaseDimensionalObject( DimensionalObject.ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, null, null,
            Lists.newArrayList( createOrganisationUnit( 'A' ), createOrganisationUnit( 'B' ) ) ) )
        .addFilter( new BaseDimensionalObject( DimensionalObject.PERIOD_DIM_ID, DimensionType.PERIOD, null, null,
            Lists.newArrayList( createPeriod( "201201" ), createPeriod( "201202" ) ) ) ).build();
    assertEquals( 2, params.getDimensions().size() );
    assertEquals( 1, params.getFilters().size() );
    params = DataQueryParams.newBuilder( params )
        .pruneToDimensionType( DimensionType.ORGANISATION_UNIT ).build();
    assertEquals( 1, params.getDimensions().size() );
    assertEquals( DimensionType.ORGANISATION_UNIT, params.getDimensions().get( 0 ).getDimensionType() );
    assertEquals( 0, params.getFilters().size() );
}