public static Socket acceptWithoutTimeout(ServerSocket serverSocket) throws IOException {
        Preconditions.checkArgument(
                serverSocket.getSoTimeout() == 0, "serverSocket SO_TIMEOUT option must be 0");
        while (true) {
            try {
                return serverSocket.accept();
            } catch (SocketTimeoutException exception) {
                // This should be impossible given that the socket timeout is set to zero
                // which indicates an infinite timeout. This is due to the underlying JDK-8237858
                // bug. We retry the accept call indefinitely to replicate the expected behavior.
            }
        }
    }
@Test
    void testAcceptWithoutTimeoutRejectsSocketWithSoTimeout() {
        assertThatThrownBy(
                        () -> {
                            try (final ServerSocket serverSocket = new ServerSocket(0)) {
                                serverSocket.setSoTimeout(5);
                                NetUtils.acceptWithoutTimeout(serverSocket);
                            }
                        })
                .isInstanceOf(IllegalArgumentException.class);
    }