@Test
public void from1() throws Exception {

    ConsumerConfig consumerConfig = new ConsumerConfig().setProtocol("test")
        .setBootstrap("test");
    ConsumerBootstrap bootstrap = Bootstraps.from(consumerConfig);
    Assert.assertEquals(TestConsumerBootstrap.class, bootstrap.getClass());
    Assert.assertEquals(consumerConfig, bootstrap.getConsumerConfig());
    // if not set bootstrap
    consumerConfig = new ConsumerConfig().setProtocol("test");
    bootstrap = Bootstraps.from(consumerConfig);
    Assert.assertEquals(TestConsumerBootstrap.class, bootstrap.getClass());
    Assert.assertEquals(consumerConfig, bootstrap.getConsumerConfig());
    // if not set bootstrap and not exist 
    consumerConfig = new ConsumerConfig().setProtocol("xx");
    bootstrap = Bootstraps.from(consumerConfig);
    Assert.assertEquals(TestConsumerBootstrap.class, bootstrap.getClass());
    Assert.assertEquals(consumerConfig, bootstrap.getConsumerConfig());
}