### Question:
StepAnalyzer extends BaseKettleMetaverseComponent implements
  IClonableStepAnalyzer<T>, IFieldLineageMetadataProvider<T> { protected Set<ComponentDerivationRecord> getPassthroughChanges() { Set<ComponentDerivationRecord> passthroughs = new HashSet<>(); if ( getInputs() != null ) { Set<StepField> incomingFieldNames = getInputs().getFieldNames(); for ( StepField incomingFieldName : incomingFieldNames ) { if ( isPassthrough( incomingFieldName ) ) { ComponentDerivationRecord change = new ComponentDerivationRecord( incomingFieldName.getFieldName(), incomingFieldName.getFieldName() ); change.setOriginalEntityStepName( incomingFieldName.getStepName() ); passthroughs.add( change ); } } } return passthroughs; }  @Override IMetaverseNode analyze( IComponentDescriptor descriptor, T meta ); @Override void postAnalyze( T meta ); Set<String> getInputStepNames( final T meta, final String fieldName ); String getStepName(); StepNodes getInputs(); StepNodes getOutputs(); void setDescriptor( IComponentDescriptor descriptor ); IComponentDescriptor getDescriptor(); Set<StepField> createStepFields( String fieldName, StepNodes stepNodes ); void validateState( IComponentDescriptor descriptor, T object ); IConnectionAnalyzer getConnectionAnalyzer(); void setConnectionAnalyzer( IConnectionAnalyzer connectionAnalyzer ); Map<String, RowMetaInterface> getInputFields( final TransMeta parentTransMeta,
                                                       final StepMeta parentStepMeta ); @Override Map<String, RowMetaInterface> getInputFields( T meta ); @Override RowMetaInterface getOutputFields( T meta ); @Override Set<IFieldMapping> getFieldMappings( T meta ); @Override Set<ComponentDerivationRecord> getChangeRecords( T meta ); void loadInputAndOutputStreamFields( T meta ); @Override final IClonableStepAnalyzer cloneAnalyzer(); IMetaverseNode getNode( final String name, final String type, final INamespace namespace,
                                 final String nodeKey, final Map<String, IMetaverseNode> nodeMap ); @Override void setDocumentAnalyzer( final IClonableDocumentAnalyzer documentAnalyzer ); @Override IClonableDocumentAnalyzer getDocumentAnalyzer(); @Override void setDocumentDescriptor( final IComponentDescriptor documentDescriptor ); @Override IComponentDescriptor getDocumentDescriptor(); @Override void setDocumentPath( final String documentPath ); static final String NONE; }### Answer:
@Test public void testGetPassthroughChanges() throws Exception { doReturn( inputs ).when( analyzer ).getInputs(); doReturn( true ).when( analyzer ).isPassthrough( any( StepField.class ) ); Set<ComponentDerivationRecord> passthroughChanges = analyzer.getPassthroughChanges(); assertTrue( CollectionUtils.isNotEmpty( passthroughChanges ) ); assertEquals( inputs.getFieldNames().size(), passthroughChanges.size() ); for ( ComponentDerivationRecord passthroughChange : passthroughChanges ) { assertEquals( passthroughChange.getChangedEntityName(), passthroughChange.getOriginalEntityName() ); } }
@Test public void testGetPassthroughChanges_noInputs() throws Exception { Set passthroughChanges = analyzer.getPassthroughChanges(); assertTrue( CollectionUtils.isEmpty( passthroughChanges ) ); }