@Override
  public Object clone() {
    MultiMergeJoinMeta retval = (MultiMergeJoinMeta) super.clone();
    int nrKeys = keyFields == null ? 0 : keyFields.length;
    int nrSteps = inputSteps == null ? 0 : inputSteps.length;
    retval.allocateKeys( nrKeys );
    retval.allocateInputSteps( nrSteps );
    System.arraycopy( keyFields, 0, retval.keyFields, 0, nrKeys );
    System.arraycopy( inputSteps, 0, retval.inputSteps, 0, nrSteps );
    return retval;
  }
@Test
  public void cloneTest() throws Exception {
    MultiMergeJoinMeta meta = new MultiMergeJoinMeta();
    meta.allocateKeys( 2 );
    meta.allocateInputSteps( 3 );
    meta.setKeyFields( new String[] { "key1", "key2" } );
    meta.setInputSteps( new String[] { "step1", "step2", "step3" } );
    // scalars should be cloned using super.clone() - makes sure they're calling super.clone()
    meta.setJoinType( "INNER" );
    MultiMergeJoinMeta aClone = (MultiMergeJoinMeta) meta.clone();
    Assert.assertFalse( aClone == meta );
    Assert.assertTrue( Arrays.equals( meta.getKeyFields(), aClone.getKeyFields() ) );
    Assert.assertTrue( Arrays.equals( meta.getInputSteps(), aClone.getInputSteps() ) );
    Assert.assertEquals( meta.getJoinType(), aClone.getJoinType() );
  }