@Override
  public void copyParametersFrom( NamedParams aParam ) {
    if ( params != null && aParam != null ) {
      params.clear();
      String[] keys = aParam.listParameters();
      for ( int idx = 0; idx < keys.length; idx++ ) {
        String desc;
        try {
          desc = aParam.getParameterDescription( keys[idx] );
        } catch ( UnknownParamException e ) {
          desc = "";
        }
        String defValue;
        try {
          defValue = aParam.getParameterDefault( keys[idx] );
        } catch ( UnknownParamException e ) {
          defValue = "";
        }
        String value;
        try {
          value = aParam.getParameterValue( keys[idx] );
        } catch ( UnknownParamException e ) {
          value = "";
        }

        try {
          addParameterDefinition( keys[idx], defValue, desc );
        } catch ( DuplicateParamException e ) {
          // Do nothing, just overwrite.
        }
        setParameterValue( keys[idx], value );
      }
    }
  }
@Test
  public void testCopyParametersFromNullChecks() throws Exception {
    // Test null case
    namedParams.copyParametersFrom( null );

    NamedParams namedParams2 = new NamedParamsDefault();

    // Test internal params == null case
    ( (NamedParamsDefault) namedParams ).params = null;
    namedParams.copyParametersFrom( namedParams2 );
  }