public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
    meta = (SwitchCaseMeta) smi;
    data = (SwitchCaseData) sdi;

    Object[] r = getRow(); // Get next usable row from input rowset(s)!
    if ( r == null ) { // no more input to be expected...

      setOutputDone();
      return false;
    }

    if ( first ) {
      first = false;

      // map input to output streams
      createOutputValueMapping();
    }

    // We already know the target values, but we need to make sure that the input data type is the same as the specified
    // one.
    // Perhaps there is some conversion needed.
    //
    Object lookupData = data.valueMeta.convertData( data.inputValueMeta, r[data.fieldIndex] );

    // could not use byte[] as key in Maps, so we need to convert it to his specific hashCode for comparisons
    lookupData = prepareObjectType( lookupData );

    // Determine the output set of rowset to use...
    Set<RowSet> rowSetSet = ( data.valueMeta.isNull( lookupData ) ) ? data.nullRowSetSet : data.outputMap.get( lookupData );

    // If the rowset is still not found (unspecified key value, we drop down to the default option
    // For now: send it to the default step...
    if ( rowSetSet == null ) {
      rowSetSet = data.defaultRowSetSet;
    }

    for ( RowSet rowSet : rowSetSet ) {
      putRowTo( data.outputRowMeta, r, rowSet );
    }

    if ( checkFeedback( getLinesRead() ) ) {
      if ( log.isBasic() ) {
        logBasic( BaseMessages.getString( PKG, "SwitchCase.Log.LineNumber" ) + getLinesRead() );
      }
    }

    return true;
  }
@Test
  public void testProcessRow() throws KettleException {
    SwitchCaseCustom krasavez = new SwitchCaseCustom( mockHelper );
    krasavez.first = false;

    // create two output row sets
    RowSet rowSetOne = new QueueRowSet();
    RowSet rowSetTwo = new QueueRowSet();

    // this row set should contain only '3'.
    krasavez.data.outputMap.put( 3, rowSetOne );
    krasavez.data.outputMap.put( 3, rowSetTwo );

    // this row set contains nulls only
    RowSet rowSetNullOne = new QueueRowSet();
    RowSet rowSetNullTwo = new QueueRowSet();
    krasavez.data.nullRowSetSet.add( rowSetNullOne );
    krasavez.data.nullRowSetSet.add( rowSetNullTwo );

    // this row set contains all expect null or '3'
    RowSet def = new QueueRowSet();
    krasavez.data.defaultRowSetSet.add( def );

    // generate some data (see method implementation)
    // expected: 5 times null,
    // expected 1*2 = 2 times 3
    // expected 5*2 + 5 = 15 rows generated
    // expected 15 - 5 - 2 = 8 rows go to default.
    // expected one empty string at the end
    // System.out.println( krasavez.getInputDataOverview() );
    // 1, 1, null, 2, 2, null, 3, 3, null, 4, 4, null, 5, 5, null,""
    krasavez.generateData( 1, 5, 2 );

    // call method under test
    krasavez.processRow();

    assertEquals( "First row set collects 2 rows", 2, rowSetOne.size() );
    assertEquals( "Second row set collects 2 rows", 2, rowSetTwo.size() );

    assertEquals( "First null row set collects 5 rows", 6, rowSetNullOne.size() );
    assertEquals( "Second null row set collects 5 rows", 6, rowSetNullTwo.size() );

    assertEquals( "Default row set collects the rest of rows", 8, def.size() );

    // now - check the data is correct in every row set:
    assertEquals( "First row set contains only 3: ", true, isRowSetContainsValue(
      rowSetOne, new Object[] { 3 }, new Object[] { } ) );
    assertEquals( "Second row set contains only 3: ", true, isRowSetContainsValue(
      rowSetTwo, new Object[] { 3 }, new Object[] { } ) );

    assertEquals( "First null row set contains only null: ", true, isRowSetContainsValue(
      rowSetNullOne, new Object[] { null }, new Object[] { } ) );
    assertEquals( "Second null row set contains only null: ", true, isRowSetContainsValue(
      rowSetNullTwo, new Object[] { null }, new Object[] { } ) );

    assertEquals( "Default row set do not contains null or 3, but other", true, isRowSetContainsValue(
      def, new Object[] { 1, 2, 4, 5 }, new Object[] { 3, null } ) );
  }