protected void updateResult( Result result ) {
    Result newResult = trans.getResult();
    result.clear(); // clear only the numbers, NOT the files or rows.
    result.add( newResult );
    if ( !Utils.isEmpty( newResult.getRows() ) || trans.isResultRowsSet() ) {
      result.setRows( newResult.getRows() );
    }
  }
@Test
  public void updateResultTestWithZeroRowsForced() {
    JobEntryTrans jobEntryTrans = spy( getJobEntryTrans() );
    Trans transMock = mock( Trans.class );
    InternalState.setInternalState( jobEntryTrans, "trans", transMock );
    //Transformation returns result with 0 rows
    when( transMock.getResult() ).thenReturn( generateDummyResult( 0 ) );
    //Previous result has 3 rows
    Result resultToBeUpdated = generateDummyResult( 3 );
    //Result Set Was updated
    when( transMock.isResultRowsSet() ).thenReturn( true );
    //Update the result
    jobEntryTrans.updateResult( resultToBeUpdated );
    //Result should have zero number of rows since the result rows has no rows but the result set was in fact updated
    //(meaning something was done that resulted in zero rows.
    assertEquals( resultToBeUpdated.getRows().size(), 0 );
  }