ConnectionFactory { public static Connection fromHostList(String... brokers) { return new Connection(Arrays.asList(brokers), _transportFactory.buildTransport()); } private  ConnectionFactory(); static Connection fromZookeeper(String zkUrl); static Connection fromProperties(Properties properties); static Connection fromHostList(String... brokers);  }
@Test public void testBrokerList() { String broker1 = "127.0.0.1:1234"; String broker2 = "localhost:2345"; Connection connection = ConnectionFactory.fromHostList(broker1, broker2); List<String> brokers = new ArrayList<String>(); brokers.add(broker1); brokers.add(broker2); Assert.assertEquals(connection.getBrokerList(), brokers); }