### Question:
MessageWriter { Future<Boolean> writeProcessRecordsMessage(ProcessRecordsInput processRecordsInput) { return writeMessage(new ProcessRecordsMessage(processRecordsInput)); } MessageWriter();   }### Answer:
@Test public void writeProcessRecordsMessageTest() throws IOException, InterruptedException, ExecutionException { List<KinesisClientRecord> records = Arrays.asList( KinesisClientRecord.builder().data(ByteBuffer.wrap("kitten".getBytes())).partitionKey("some cats") .sequenceNumber("357234807854789057805").build(), KinesisClientRecord.builder().build() ); Future<Boolean> future = this.messageWriter.writeProcessRecordsMessage(ProcessRecordsInput.builder().records(records).build()); future.get(); verify(this.stream, Mockito.atLeastOnce()).write(Mockito.any(byte[].class), Mockito.anyInt(), Mockito.anyInt()); verify(this.stream, Mockito.atLeastOnce()).flush(); }