### Question:
MessageWriter { Future<Boolean> writeShutdownRequestedMessage() { return writeMessage(new ShutdownRequestedMessage()); } MessageWriter();   }### Answer:
@Test public void writeShutdownRequestedMessageTest() throws IOException, InterruptedException, ExecutionException { Future<Boolean> future = this.messageWriter.writeShutdownRequestedMessage(); future.get(); verify(this.stream, Mockito.atLeastOnce()).write(Mockito.any(byte[].class), Mockito.anyInt(), Mockito.anyInt()); verify(this.stream, Mockito.atLeastOnce()).flush(); }