public static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
                                                                TransMeta sourceTransMeta, StepMeta stepMeta ) {
    String[] stepNamesArray = sourceTransMeta.getPrevStepNames( stepMeta );
    Set<String> existedStepNames = convertToUpperCaseSet( stepNamesArray );
    Set<SourceStepField> unavailableSourceSteps = new HashSet<SourceStepField>();
    for ( SourceStepField currentSource : targetMap.values() ) {
      if ( currentSource.getStepname() != null ) {
        if ( !existedStepNames.contains( currentSource.getStepname().toUpperCase() ) ) {
          unavailableSourceSteps.add( currentSource );
        }
      }
    }
    return Collections.unmodifiableSet( unavailableSourceSteps );
  }
@Test
  public void getUnavailableSourceSteps() {
    TargetStepAttribute targetStep = new TargetStepAttribute( TEST_TARGET_STEP_NAME, TEST_ATTR_VALUE, false );
    SourceStepField unavailableSourceStep = new SourceStepField( UNAVAILABLE_STEP, TEST_FIELD );
    Map<TargetStepAttribute, SourceStepField> targetMap = Collections.singletonMap( targetStep, unavailableSourceStep );
    TransMeta sourceTransMeta = mock( TransMeta.class );
    doReturn( new String[0] ).when( sourceTransMeta ).getPrevStepNames( any( StepMeta.class ) );

    Set<SourceStepField> actualSet =
        MetaInject.getUnavailableSourceSteps( targetMap, sourceTransMeta, mock( StepMeta.class ) );
    assertTrue( actualSet.contains( unavailableSourceStep ) );
  }