public static Map<String, String> parseMapProperty(String property) {
    Map<String, String> result = new LinkedHashMap<>(); // LinkedHashMap to keep insertion order

    // Split on non-escaped commas
    List<String> entries = parseListProperty(property);
    for (String entry : entries) {
      Matcher matcher = KEY_VALUE_PATTERN.matcher(entry);
      if (!matcher.matches()) {
        throw new IllegalArgumentException("'" + entry + "' is not a valid key-value pair");
      }
      result.put(matcher.group("name"), matcher.group("value"));
    }
    return result;
  }
@Test
  public void testParseMapProperty() {
    assertThat(ConfigurationPropertyValidator.parseMapProperty("abc=def"))
        .containsExactly("abc", "def");
    assertThat(
            ConfigurationPropertyValidator.parseMapProperty(
                "abc=def,gh\\,i=j\\\\\\,kl,mno=,pqr=stu"))
        .containsExactly("abc", "def", "gh,i", "j\\\\,kl", "mno", "", "pqr", "stu")
        .inOrder();
    assertThrows(
        IllegalArgumentException.class,
        () -> ConfigurationPropertyValidator.parseMapProperty("not valid"));
  }