<BUG>try (final ConnectionImpl nc = (ConnectionImpl) spy(opts.connect(Nats.DEFAULT_URL))) {</BUG><CONTEXT>public void testReleaseFlush() throws Exception {thrown.expect(IllegalStateException.class);thrown.expectMessage(Nats.ERR_CONNECTION_CLOSED);try (NatsServer srv = runDefaultServer()) {Options opts = new Options.Builder().noReconnect().build();<extra_id_0>for (int i = 0; i < 1000; i++) {nc.publish("foo", "Hello".getBytes());}</CONTEXT>
try (final ConnectionImpl nc = (ConnectionImpl) spy(newDefaultConnection())) {