### Question:
StringsCutStepAnalyzer extends StepAnalyzer<StringCutMeta> { @Override protected Set<StepField> getUsedFields( StringCutMeta meta ) { HashSet<StepField> usedFields = new HashSet<>(); for ( String fieldInString : meta.getFieldInStream() ) { usedFields.addAll( createStepFields( fieldInString, getInputs() ) ); } return usedFields; }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override Set<ComponentDerivationRecord> getChangeRecords( StringCutMeta meta );  }### Answer:
@Test public void testGetUsedFields() { Set<StepField> fields = new HashSet<>(); fields.add( new StepField( "prev", "firstName" ) ); fields.add( new StepField( "prev", "middleName" ) ); fields.add( new StepField( "prev", "lastName" ) ); doReturn( fields ).when( analyzer ).createStepFields( anyString(), any( StepNodes.class ) ); Set<StepField> usedFields = analyzer.getUsedFields( stringsCutMeta ); List<String> inFields = Arrays.asList( stringsCutMeta.getFieldInStream() ); for ( StepField usedField : usedFields ) { assertTrue( inFields.contains( usedField.getFieldName() ) ); } }