ProtocolFactory { public static Protocol getProtocol(String alias) { return EXTENSION_LOADER.getExtension(alias); }  static Protocol getProtocol(String alias); static Protocol getProtocol(byte code); static Byte getCodeByAlias(String protocol); static Protocol adaptiveProtocol(byte[] magicHeadBytes); static int getMaxMagicOffset();  }
@Test public void getProtocol() throws Exception { Protocol protocol = ProtocolFactory.getProtocol("xx"); Assert.assertNotNull(protocol); Assert.assertEquals(protocol.getClass(), TestProtocol.class); }
@Test public void getProtocol1() throws Exception { Protocol protocol = ProtocolFactory.getProtocol((byte) 121); Assert.assertNotNull(protocol); Assert.assertEquals(protocol.getClass(), TestProtocol.class); }