### Question:
NetworkConnection implements Connection { @Override public void flush() { if ( verifyOpen( null, null ) ) { flushInEventLoop(); } } NetworkConnection( Channel channel, ExtendedChannelPool channelPool, Clock clock, MetricsListener metricsListener ); @Override boolean isOpen(); @Override void enableAutoRead(); @Override void disableAutoRead(); @Override void flush(); @Override void write( Message message, ResponseHandler handler ); @Override void write( Message message1, ResponseHandler handler1, Message message2, ResponseHandler handler2 ); @Override void writeAndFlush( Message message, ResponseHandler handler ); @Override void writeAndFlush( Message message1, ResponseHandler handler1, Message message2, ResponseHandler handler2 ); @Override CompletionStage<Void> reset(); @Override CompletionStage<Void> release(); @Override void terminateAndRelease( String reason ); @Override BoltServerAddress serverAddress(); @Override ServerVersion serverVersion(); @Override BoltProtocol protocol();  }### Answer:
@Test void shouldFlushInEventLoopThread() throws Exception { EmbeddedChannel channel = spy( new EmbeddedChannel() ); initializeEventLoop( channel, "Flush" ); ChannelAttributes.setProtocolVersion( channel, DEFAULT_TEST_PROTOCOL_VERSION ); NetworkConnection connection = newConnection( channel ); connection.flush(); shutdownEventLoop(); verify( channel ).flush(); }