public static void setProtocolEngine(Configuration conf,
                                Class<?> protocol, Class<?> engine) {
    if (conf.get(ENGINE_PROP+"."+protocol.getName()) == null) {
      conf.setClass(ENGINE_PROP+"."+protocol.getName(), engine,
                    RpcEngine.class);
    }
  }
@Test
  public void testSetProtocolEngine() {
    Configuration conf = new Configuration();
    RPC.setProtocolEngine(conf, StoppedProtocol.class, StoppedRpcEngine.class);
    RpcEngine rpcEngine = RPC.getProtocolEngine(StoppedProtocol.class, conf);
    assertTrue(rpcEngine instanceof StoppedRpcEngine);

    RPC.setProtocolEngine(conf, StoppedProtocol.class, ProtobufRpcEngine.class);
    rpcEngine = RPC.getProtocolEngine(StoppedProtocol.class, conf);
    assertTrue(rpcEngine instanceof StoppedRpcEngine);
  }