QueryItem { private List<String> getOptionSetQueryFilterItems() { return getQueryFilterItems().stream() .map( code -> optionSet.getOptionByCode( code ) ) .filter( option -> option != null ) .map( option -> option.getUid() ) .collect( Collectors.toList() ); } QueryItem( DimensionalItemObject item );  QueryItem( DimensionalItemObject item, LegendSet legendSet, ValueType valueType, AggregationType aggregationType, OptionSet optionSet );  QueryItem( DimensionalItemObject item, LegendSet legendSet, ValueType valueType, AggregationType aggregationType, OptionSet optionSet, Boolean unique );  QueryItem( DimensionalItemObject item, LegendSet legendSet, ValueType valueType, AggregationType aggregationType, OptionSet optionSet, RelationshipType relationshipType );  QueryItem( DimensionalItemObject item, Program program, LegendSet legendSet, ValueType valueType, AggregationType aggregationType, OptionSet optionSet );  QueryItem( DimensionalItemObject item, Program program, LegendSet legendSet, ValueType valueType, AggregationType aggregationType, OptionSet optionSet, RelationshipType relationshipType );  QueryItem( DimensionalItemObject item, QueryOperator operator, String filter, ValueType valueType, AggregationType aggregationType, OptionSet optionSet ); String getItemId(); String getItemName(); boolean addFilter( QueryFilter filter ); String getKey(); String getFiltersAsString(); String getTypeAsString(); boolean isNumeric(); boolean isText(); boolean hasLegendSet(); boolean hasOptionSet(); boolean hasFilter(); boolean hasProgram(); boolean hasProgramStage(); boolean isProgramIndicator(); boolean hasRelationshipType(); List<String> getLegendSetFilterItemsOrAll(); List<String> getOptionSetFilterItemsOrAll(); List<String> getQueryFilterItems(); String getSqlFilter( QueryFilter filter, String encodedFilter ); static List<QueryItem> getQueryItems( Collection<TrackedEntityAttribute> attributes ); static List<QueryItem> getDataElementQueryItems( Collection<DataElement> dataElements ); @Override int hashCode(); @Override boolean equals( Object object ); @Override String toString(); DimensionalItemObject getItem(); void setItem( DimensionalItemObject item ); LegendSet getLegendSet(); void setLegendSet( LegendSet legendSet ); List<QueryFilter> getFilters(); void setFilters( List<QueryFilter> filters ); ValueType getValueType(); void setValueType( ValueType valueType ); AggregationType getAggregationType(); void setAggregationType( AggregationType aggregationType ); OptionSet getOptionSet(); void setOptionSet( OptionSet optionSet ); Program getProgram(); void setProgram( Program program ); ProgramStage getProgramStage(); void setProgramStage( ProgramStage programStage ); Boolean isUnique(); void setUnique( Boolean unique ); RelationshipType getRelationshipType();  }
@Test public void testGetOptionSetQueryFilterItems() { QueryItem qiA = new QueryItem( deA, null, ValueType.TEXT, AggregationType.SUM, osA ); qiA.addFilter( new QueryFilter( QueryOperator.IN, "CODEA;CODEB" ) ); List<String> expected = Lists.newArrayList( "UIDA", "UIDB" ); assertEquals( expected, qiA.getOptionSetFilterItemsOrAll() ); QueryItem qiB = new QueryItem( deA, null, ValueType.TEXT, AggregationType.SUM, osA ); expected = Lists.newArrayList( "UIDA", "UIDB", "UIDC" ); assertEquals( expected, qiB.getOptionSetFilterItemsOrAll() ); }