### Question:
KafkaProducerWrapper implements Closeable, Flushable { public void send(ProducerRecord<K, T> record){ if(record == null){ throw new IllegalArgumentException("The 'record' cannot be 'null'."); } TimerContext context = SEND_TIMER.time(); try { pendingWrites.add(kafkaProducer.send(record)); } finally { context.stop(); } } KafkaProducerWrapper(Producer<K, T> kafkaProducer); void send(ProducerRecord<K, T> record); void sendSynchronously(ProducerRecord<K, T> record); void sendSynchronously(List<ProducerRecord<K, T>> records); @Override void flush(); @Override void close();  }### Answer:
@Test(expected=IllegalArgumentException.class) public void test_sendNullRecord() throws IOException, ExecutionException, InterruptedException { KafkaProducerWrapper<String, String> producer = new KafkaProducerWrapper<>(mockedProducer); producer.send(null); }