### Question:
UtilsConfig { public String generateOutput(ConfigurationOutput output) { StringBuilder sb = new StringBuilder(); sb.append("if ("+addTags(output.getListTag())+"){"+RETURN); String url = StringUtils.isNotBlank(output.getPort()) ? output.getHost() + ":" + output.getPort() : output.getHost(); sb.append(" kafka {" + RETURN); sb.append(" bootstrap_servers => \"" + url + "\"" + RETURN); sb.append(" topic_id => \"" + output.getTopic() + "\"" + RETURN); if (StringUtils.isNotBlank(output.getCodec())) { sb.append(" codec => \"" + output.getCodec() + "\"" + RETURN); } sb.append(RETURN_BRACE); sb.append(RETURN_BRACE); return sb.toString(); }  String generateConfig(ConfigurationLogstash cl); String filterAction(Translate translate); String generateFilter(Translate translate); String generateOutput(ConfigurationOutput output); String generateInput(ConfigurationHost input);  }### Answer:
@Test public void output_Kafka() { List<String> listTag = new ArrayList<>(); listTag.add("example"); String result = utilsConfig.generateOutput(ConfigurationOutput.builder().host("kafka").topic("mytopic").codec("json").listTag(listTag).build()); assertThat(result).isEqualTo("if (\"example\" in [tags]){ \n kafka { \n bootstrap_servers => \"kafka:9092\" \n topic_id => \"mytopic\" \n codec => \"json\" \n }\n }\n"); }