### Question:
CalculatorStepAnalyzer extends StepAnalyzer<CalculatorMeta> { @Override protected Set<StepField> getUsedFields( CalculatorMeta meta ) { Set<StepField> usedFields = new HashSet<>(); for ( CalculatorMetaFunction function : meta.getCalculation() ) { if ( StringUtils.isNotEmpty( function.getFieldA() ) ) { usedFields.addAll( createStepFields( function.getFieldA(), getInputs() ) ); } if ( StringUtils.isNotEmpty( function.getFieldB() ) ) { usedFields.addAll( createStepFields( function.getFieldB(), getInputs() ) ); } if ( StringUtils.isNotEmpty( function.getFieldC() ) ) { usedFields.addAll( createStepFields( function.getFieldC(), getInputs() ) ); } } return usedFields; }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override Set<ComponentDerivationRecord> getChangeRecords( final CalculatorMeta calculatorMeta ); @Override IClonableStepAnalyzer newInstance();  }### Answer:
@Test public void testGetUsedFields() throws Exception { StepNodes inputNodes = new StepNodes(); inputNodes.addNode( "input", "height", node ); inputNodes.addNode( "input", "width", node ); inputNodes.addNode( "input", "radius", node ); inputNodes.addNode( "input", "pi", node ); inputNodes.addNode( "input", "two", node ); inputNodes.addNode( "input", "NOT USED", node ); when( analyzer.getInputs() ).thenReturn( inputNodes ); Set<StepField> usedFields = analyzer.getUsedFields( calculatorMeta ); assertEquals( 5, usedFields.size() ); }