### Question:
MessageWriter { Future<Boolean> writeShardEndedMessage(@SuppressWarnings("unused") ShardEndedInput shardEndedInput) { return writeMessage(new ShardEndedMessage()); } MessageWriter();   }### Answer:
@Test public void writeShutdownMessageTest() throws IOException, InterruptedException, ExecutionException { Future<Boolean> future = this.messageWriter.writeShardEndedMessage(ShardEndedInput.builder().build()); future.get(); verify(this.stream, Mockito.atLeastOnce()).write(Mockito.any(byte[].class), Mockito.anyInt(), Mockito.anyInt()); verify(this.stream, Mockito.atLeastOnce()).flush(); }