@VisibleForTesting
  void updateValueMeta() throws KettleException {

    List<ValueMetaInterface> outputValueMetaList = data.outputRowMeta.getValueMetaList();
    List<ValueMetaInterface> aggMetaValueMetaList = data.aggMeta.getValueMetaList();
    for ( int outputIndex = 0; outputIndex < outputValueMetaList.size(); ++outputIndex ) {
      for ( int aggIndex = 0; aggIndex < aggMetaValueMetaList.size(); ++aggIndex ) {
        if ( aggMetaValueMetaList.get( aggIndex ).getName().equals( outputValueMetaList.get( outputIndex ).getName() ) ) {
          data.outputRowMeta.removeValueMeta(  outputValueMetaList.get( outputIndex ).getName() );
          data.outputRowMeta.addValueMeta( outputIndex,  aggMetaValueMetaList.get( aggIndex ) );
        }
      }
    }
  }
@Test
  public void updateValueMetaNoMatchTest() throws KettleException {
    ValueMetaString stringMetaFromOutput = new ValueMetaString( "stringMeta" );
    ValueMetaBinary binaryMetaFromOutput = new ValueMetaBinary( "binaryMeta" );
    ValueMetaBinary binaryMetaFromAgg = new ValueMetaBinary( "binaryMeta2" );
    ValueMetaInteger integerMetaFromOutput = new ValueMetaInteger( "integerMeta" );
    memGroupByData.outputRowMeta.addValueMeta( stringMetaFromOutput );
    memGroupByData.outputRowMeta.addValueMeta( binaryMetaFromOutput );
    memGroupByData.outputRowMeta.addValueMeta( integerMetaFromOutput );
    memGroupByData.aggMeta.addValueMeta( binaryMetaFromAgg );

    doCallRealMethod().when( memGroupBy ).updateValueMeta();
    memGroupBy.updateValueMeta();

    assertTrue( memGroupByData.outputRowMeta.getValueMetaList().contains( binaryMetaFromOutput ) );
    assertFalse( memGroupByData.outputRowMeta.getValueMetaList().contains( binaryMetaFromAgg ) );
  }