public static void removeUnavailableStepsFromMapping( Map<TargetStepAttribute, SourceStepField> targetMap,
                                                        Set<SourceStepField> unavailableSourceSteps, Set<TargetStepAttribute> unavailableTargetSteps ) {
    Iterator<Entry<TargetStepAttribute, SourceStepField>> targetMapIterator = targetMap.entrySet().iterator();
    while ( targetMapIterator.hasNext() ) {
      Entry<TargetStepAttribute, SourceStepField> entry = targetMapIterator.next();
      SourceStepField currentSourceStepField = entry.getValue();
      TargetStepAttribute currentTargetStepAttribute = entry.getKey();
      if ( unavailableSourceSteps.contains( currentSourceStepField ) || unavailableTargetSteps.contains(
        currentTargetStepAttribute ) ) {
        targetMapIterator.remove();
      }
    }
  }
@Test
  public void removeUnavailableStepsFromMapping_unavailable_target_step() {
    TargetStepAttribute unavailableTargetStep = new TargetStepAttribute( UNAVAILABLE_STEP, TEST_ATTR_VALUE, false );
    SourceStepField unavailableSourceStep = new SourceStepField( UNAVAILABLE_STEP, TEST_FIELD );
    Map<TargetStepAttribute, SourceStepField> targetMap = new HashMap<TargetStepAttribute, SourceStepField>();
    targetMap.put( unavailableTargetStep, unavailableSourceStep );

    Set<TargetStepAttribute> unavailableTargetSteps = Collections.singleton( UNAVAILABLE_TARGET_STEP );
    MetaInject.removeUnavailableStepsFromMapping( targetMap, Collections.<SourceStepField>emptySet(),
        unavailableTargetSteps );
    assertTrue( targetMap.isEmpty() );
  }