ComponentPropertyReader { public static String readString(Properties properties, Properties global, final String propertyName, String instanceId, ComponentMetadata componentMetadata) { return readString(properties, global, propertyName, instanceId, componentMetadata, null); } private  ComponentPropertyReader(); static String readString(Properties properties, Properties global,
                                    final String propertyName, String instanceId, ComponentMetadata componentMetadata); static String readString(Properties properties, Properties global,
                                    final String propertyName, String instanceId,
                                    ComponentMetadata componentMetadata, String defaultValue); static Integer readInteger(Properties properties, Properties global, final String propertyName,
            String instanceId, ComponentMetadata componentMetadata); static Integer readInteger(Properties properties, Properties global,
                                      final String propertyName, String instanceId,
                                      ComponentMetadata componentMetadata, Integer defaultValue); static Long readLong(Properties properties, Properties global,
                                final String propertyName, String instanceId, ComponentMetadata componentMetadata); static Long readLong(Properties properties, Properties global,
                                final String propertyName, String instanceId,
                                ComponentMetadata componentMetadata, Long defaultValue); static Boolean readBoolean(Properties properties, Properties global, final String propertyName,
            String instanceId, ComponentMetadata componentMetadata); static Boolean readBoolean(Properties properties, Properties global,
                                      final String propertyName, String instanceId,
                                      ComponentMetadata componentMetadata, Boolean defaultValue);  }
@Test public void testReadString() throws Exception { Properties properties = new Properties(); properties.setProperty("source.source_1.zookeeper", "localhost"); Properties globalProperties = new Properties(); final String connStr = ComponentPropertyReader.readString(properties, globalProperties, "zookeeper", "source_1", ComponentMetadata.builder() .namespace("global") .name("source") .id("1234") .type(ComponentType.SOURCE) .build()); assertEquals("localhost", connStr); }