@Test
public void testUpdateCoders() {

  class RSUserDefinedIncorrectFactory implements RawErasureCoderFactory {
    public RawErasureEncoder createEncoder(ErasureCoderOptions coderOptions) {
      return null;
    }
    public RawErasureDecoder createDecoder(ErasureCoderOptions coderOptions) {
      return null;
    }
    public String getCoderName() {
      return "rs_java";
    }
    public String getCodecName() {
      return ErasureCodeConstants.RS_CODEC_NAME;
    }
  }
  List<RawErasureCoderFactory> userDefinedFactories = new ArrayList<>();
  userDefinedFactories.add(new RSUserDefinedIncorrectFactory());
  CodecRegistry.getInstance().updateCoders(userDefinedFactories);
  // check RS coders
  List<RawErasureCoderFactory> rsCoders = CodecRegistry.getInstance().
      getCoders(ErasureCodeConstants.RS_CODEC_NAME);
  assertEquals(2, rsCoders.size());
  assertTrue(rsCoders.get(0) instanceof NativeRSRawErasureCoderFactory);
  assertTrue(rsCoders.get(1) instanceof RSRawErasureCoderFactory);
  // check RS coder names
  String[] rsCoderNames = CodecRegistry.getInstance().
      getCoderNames(ErasureCodeConstants.RS_CODEC_NAME);
  assertEquals(2, rsCoderNames.length);
  assertEquals(NativeRSRawErasureCoderFactory.CODER_NAME, rsCoderNames[0]);
  assertEquals(RSRawErasureCoderFactory.CODER_NAME, rsCoderNames[1]);
}