### Question:
TaskHelper { public static String createUrlPathFromProperties(Map<String, String> props, String prefix) { return props.keySet().stream() .filter(k -> k.startsWith(prefix)) .map(props::get) .reduce((p1, p2) -> p1 + ":" + p2) .orElse(""); } private  TaskHelper(); static String buildUrl(RuntimeCamelCatalog rcc, Map<String, String> props, String componentSchema, String endpointPropertiesPrefix, String pathPropertiesPrefix); static String buildUrl(Map<String, String> props, String componentSchema, String endpointPropertiesPrefix, String pathPropertiesPrefix); static String createEndpointOptionsFromProperties(Map<String, String> props, String prefix); static String createUrlPathFromProperties(Map<String, String> props, String prefix); static Map<String, String> mergeProperties(Map<String, String> defaultProps, Map<String, String> loadedProps); static void logRecordContent(Logger logger, ConnectRecord<?> record, CFG config);  }### Answer:
@Test public void testCreateUrlPathFromProperties() { Map<String, String> props = new HashMap<String, String>() { { put("prefix.key1", "value1"); put("notprefix.key2", "value2"); } }; String result = TaskHelper.createUrlPathFromProperties(props, "prefix."); assertEquals("value1", result); }
@Test public void testCreateUrlPathFromPropertiesConcatenation() { Map<String, String> props = new HashMap<String, String>() { { put("prefix.key1", "value1"); put("prefix.key2", "value2"); } }; String result = TaskHelper.createUrlPathFromProperties(props, "prefix."); assertEquals("value1:value2", result); }
@Test public void testCreateUrlPathFromPropertiesEmpty() { Map<String, String> props = new HashMap<String, String>() { { put("prefix.key1", "value1"); put("notprefix.key2", "value2"); } }; String result = TaskHelper.createUrlPathFromProperties(props, "anotherprefix"); assertEquals("", result); }