Github user afine commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/474#discussion_r171980950 --- Diff: src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java --- @@ -103,4 +105,22 @@ public void testValidSelectionKey() throws Exception { zk.close(); } } + + @Test(timeout = 30000) + public void testServerCnxnGetAuthInfoWithCopy() throws Exception { + final ZooKeeper zk = createZKClient(hostPort, 3000); + try { + Iterable<ServerCnxn> connections = serverFactory.getConnections(); + for (ServerCnxn serverCnxn : connections) { + List<Id> authInfo = serverCnxn.getAuthInfo(); + Id id = new Id("testscheme", "test"); + serverCnxn.addAuthInfo(id); + Assert.assertTrue(!authInfo.contains(id)); --- End diff -- nit: let's use assertFalse
---