public int getEvaluationMethodByDesc( String evaluationMethodDesc ) {
    if ( null != evaluationMethodDesc ) {
      for ( int i = 0; i < EVALUATION_METHOD_DESCS.length; ++i ) {
        if ( EVALUATION_METHOD_DESCS[ i ].equalsIgnoreCase( evaluationMethodDesc ) ) {
          return i;
        }
      }
      // If this fails, try to match using the code.
      return getEvaluationMethodByCode( evaluationMethodDesc );
    }

    return DEFAULT_EVALUATION_METHOD;
  }
@Test
  public void testGetEvaluationMethodByDesc() throws Exception {
    CheckSumMeta checkSumMeta = new CheckSumMeta();

    // Passing 'null'
    int evaluationMethod = checkSumMeta.getEvaluationMethodByDesc( null );
    assertEquals( CheckSumMeta.DEFAULT_EVALUATION_METHOD, evaluationMethod );

    // Passing an unknown description
    evaluationMethod = checkSumMeta.getEvaluationMethodByDesc( "$#%#&$/(%&%#$%($/)" );
    assertEquals( CheckSumMeta.DEFAULT_EVALUATION_METHOD, evaluationMethod );

    // The descriptions
    evaluationMethod = checkSumMeta
      .getEvaluationMethodByDesc( CheckSumMeta.EVALUATION_METHOD_DESCS[ CheckSumMeta.EVALUATION_METHOD_BYTES ] );
    assertEquals( CheckSumMeta.EVALUATION_METHOD_BYTES, evaluationMethod );

    evaluationMethod =
      checkSumMeta.getEvaluationMethodByDesc( Const.KETTLE_CHECKSUM_EVALUATION_METHOD_PENTAHO_STRINGS );
    assertEquals( CheckSumMeta.EVALUATION_METHOD_PENTAHO_STRINGS, evaluationMethod );

    evaluationMethod = checkSumMeta.getEvaluationMethodByDesc(
      CheckSumMeta.EVALUATION_METHOD_DESCS[ CheckSumMeta.EVALUATION_METHOD_NATIVE_STRINGS ] );
    assertEquals( CheckSumMeta.EVALUATION_METHOD_NATIVE_STRINGS, evaluationMethod );

    // Passing the Code instead of the description
    evaluationMethod = checkSumMeta.getEvaluationMethodByDesc( Const.KETTLE_CHECKSUM_EVALUATION_METHOD_BYTES );
    assertEquals( CheckSumMeta.EVALUATION_METHOD_BYTES, evaluationMethod );

    evaluationMethod =
      checkSumMeta.getEvaluationMethodByDesc( Const.KETTLE_CHECKSUM_EVALUATION_METHOD_PENTAHO_STRINGS );
    assertEquals( CheckSumMeta.EVALUATION_METHOD_PENTAHO_STRINGS, evaluationMethod );

    evaluationMethod = checkSumMeta.getEvaluationMethodByDesc( Const.KETTLE_CHECKSUM_EVALUATION_METHOD_NATIVE_STRINGS );
    assertEquals( CheckSumMeta.EVALUATION_METHOD_NATIVE_STRINGS, evaluationMethod );
  }