ConfigurableWithParent extends Configurable { @Override public Map<String, Object> getKafkaConfig() { Map<String, Object> config = getConfig(); if (parent == null) { return config; } if (_mergedConfig == null) { _mergedConfig = merge(parent.getKafkaConfig(), config); } return _mergedConfig; }  Configurable getParent(); @JsonBackReference void setParent(Configurable parent); @Override Map<String, Object> getKafkaConfig(); @Override String getTopic();  }
@Test public void testGetMergedConfig_noParent() { TestConfigurable child = new TestConfigurable(); { Map<String, Object> config = new HashMap<>(); config.put(PROP_1, 1); child.setConfig(config); } Map<String, Object> mergedConfig = child.getKafkaConfig(); assertThat(mergedConfig.get(PROP_1), equalTo(1)); assertThat(mergedConfig.get(PROP_2), nullValue()); }