### Question:
NIOServerCnxnFactory extends ServerCnxnFactory { @Override public void start() { stopped = false; if (workerPool == null) { workerPool = new WorkerService("NIOWorker", numWorkerThreads, false); } for (SelectorThread thread : selectorThreads) { if (thread.getState() == Thread.State.NEW) { thread.start(); } } if (acceptThread.getState() == Thread.State.NEW) { acceptThread.start(); } if (expirerThread.getState() == Thread.State.NEW) { expirerThread.start(); } } NIOServerCnxnFactory(); static ByteBuffer getDirectBuffer(); @Override void configure(InetSocketAddress addr, int maxcc, int backlog, boolean secure); @Override void reconfigure(InetSocketAddress addr); int getMaxClientCnxnsPerHost(); void setMaxClientCnxnsPerHost(int max); int getSocketListenBacklog(); @Override void start(); @Override void startup(ZooKeeperServer zks, boolean startServer); @Override InetSocketAddress getLocalAddress(); @Override int getLocalPort(); boolean removeCnxn(NIOServerCnxn cnxn); void touchCnxn(NIOServerCnxn cnxn); @Override @SuppressWarnings("unchecked") void closeAll(ServerCnxn.DisconnectReason reason); void stop(); void shutdown(); @Override void join(); @Override Iterable<ServerCnxn> getConnections(); void dumpConnections(PrintWriter pwriter); @Override void resetAllConnectionStats(); @Override Iterable<Map<String, Object>> getAllConnectionInfo(boolean brief); static final String ZOOKEEPER_NIO_SESSIONLESS_CNXN_TIMEOUT; static final String ZOOKEEPER_NIO_NUM_SELECTOR_THREADS; static final String ZOOKEEPER_NIO_NUM_WORKER_THREADS; static final String ZOOKEEPER_NIO_DIRECT_BUFFER_BYTES; static final String ZOOKEEPER_NIO_SHUTDOWN_TIMEOUT; }### Answer:
@Test public void testStartupWithStart_SocketAlreadyBound() throws IOException { assertThrows(SocketException.class, () -> { factory.start(); ServerSocket ss = new ServerSocket(listenAddress.getPort()); }); }