public void addStep( StepMeta stepMeta ) {
    steps.add( stepMeta );
    stepMeta.setParentTransMeta( this );
    StepMetaInterface iface = stepMeta.getStepMetaInterface();
    if ( iface instanceof StepMetaChangeListenerInterface ) {
      addStepChangeListener( (StepMetaChangeListenerInterface) iface );
    }
    changed_steps = true;
    clearCaches();
  }
@Test
  public void testAddStepWithChangeListenerInterface() {
    StepMeta stepMeta = mock( StepMeta.class );
    StepMetaChangeListenerInterfaceMock metaInterface = mock( StepMetaChangeListenerInterfaceMock.class );
    when( stepMeta.getStepMetaInterface() ).thenReturn( metaInterface );
    assertEquals( 0, transMeta.steps.size() );
    assertEquals( 0, transMeta.stepChangeListeners.size() );
    // should not throw exception if there are no steps in step meta
    transMeta.addStep( 0, stepMeta );
    assertEquals( 1, transMeta.steps.size() );
    assertEquals( 1, transMeta.stepChangeListeners.size() );

    transMeta.addStep( 0, stepMeta );
    assertEquals( 2, transMeta.steps.size() );
    assertEquals( 2, transMeta.stepChangeListeners.size() );
  }