public RawErasureCoderFactory getCoderByName(
      String codecName, String coderName) {
    List<RawErasureCoderFactory> coders = getCoders(codecName);

    // find the RawErasureCoderFactory with the name of coderName
    for (RawErasureCoderFactory coder : coders) {
      if (coder.getCoderName().equals(coderName)) {
        return coder;
      }
    }
    return null;
  }
@Test
  public void testGetCoderByName() {
    RawErasureCoderFactory coder = CodecRegistry.getInstance().
            getCoderByName(ErasureCodeConstants.RS_CODEC_NAME,
        RSRawErasureCoderFactory.CODER_NAME);
    assertTrue(coder instanceof RSRawErasureCoderFactory);

    coder = CodecRegistry.getInstance().getCoderByName(
        ErasureCodeConstants.RS_CODEC_NAME,
        NativeRSRawErasureCoderFactory.CODER_NAME);
    assertTrue(coder instanceof NativeRSRawErasureCoderFactory);

    coder = CodecRegistry.getInstance().getCoderByName(
        ErasureCodeConstants.RS_LEGACY_CODEC_NAME,
        RSLegacyRawErasureCoderFactory.CODER_NAME);
    assertTrue(coder instanceof RSLegacyRawErasureCoderFactory);

    coder = CodecRegistry.getInstance().getCoderByName(
        ErasureCodeConstants.XOR_CODEC_NAME,
        XORRawErasureCoderFactory.CODER_NAME);
    assertTrue(coder instanceof XORRawErasureCoderFactory);

    coder = CodecRegistry.getInstance().getCoderByName(
        ErasureCodeConstants.XOR_CODEC_NAME,
        NativeXORRawErasureCoderFactory.CODER_NAME);
    assertTrue(coder instanceof NativeXORRawErasureCoderFactory);
  }