### Question:
GroupByStepAnalyzer extends StepAnalyzer<GroupByMeta> { @Override protected Set<StepField> getUsedFields( GroupByMeta meta ) { Set<StepField> usedFields = new HashSet<>(); String[] groupFields = meta.getGroupField(); for ( String groupField : groupFields ) { usedFields.addAll( createStepFields( groupField, getInputs() ) ); } String[] subjectFields = meta.getSubjectField(); for ( String subjectField : subjectFields ) { usedFields.addAll( createStepFields( subjectField, getInputs() ) ); } return usedFields; }  @Override Set<ComponentDerivationRecord> getChangeRecords( final GroupByMeta groupByMeta ); @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override IClonableStepAnalyzer newInstance();  }### Answer:
@Test public void testGetUsedFields() throws Exception { Set<StepField> fields = new HashSet<>(); fields.add( new StepField( "prev", "member" ) ); fields.add( new StepField( "prev", "donation" ) ); fields.add( new StepField( "prev", "state" ) ); fields.add( new StepField( "prev", "country" ) ); doReturn( fields ).when( analyzer ).createStepFields( anyString(), any( StepNodes.class ) ); Set<StepField> usedFields = analyzer.getUsedFields( meta ); int expectedUsedFieldCount = mockAggregateFields.length + mockSubjectFields.length; assertEquals( expectedUsedFieldCount, usedFields.size() ); verify( analyzer, times( expectedUsedFieldCount ) ).createStepFields( anyString(), any( StepNodes.class ) ); }