### Question:
KafkaMessageSender { @VisibleForTesting static String topic(Configuration conf) { return checkNotNull(stringProperty(conf, TOPIC_NAME), "Property " + TOPIC_NAME + " is not set"); } KafkaMessageSender(Configuration conf); @VisibleForTesting  KafkaMessageSender(String topic, KafkaProducer<Long, byte[]> producer); void send(KafkaMessage kafkaMessage);  }### Answer:
@Test public void hadoopTopicIsNotNull() { conf.set(TOPIC_NAME.key(), "topic"); assertThat(topic(conf)).isEqualTo("topic"); }
@Test(expected = NullPointerException.class) public void topicIsNull() { topic(conf); }