public static Map<String, ActiveRuleParamDto> groupByKey(Collection<ActiveRuleParamDto> params) {
    Map<String, ActiveRuleParamDto> result = new HashMap<>();
    for (ActiveRuleParamDto param : params) {
      result.put(param.getKey(), param);
    }
    return result;
  }
@Test
  void groupByKey() {
    assertThat(ActiveRuleParamDto.groupByKey(Collections.emptyList())).isEmpty();

    Collection<ActiveRuleParamDto> dtos = Arrays.asList(
      new ActiveRuleParamDto().setKey("foo"), new ActiveRuleParamDto().setKey("bar"));
    Map<String, ActiveRuleParamDto> group = ActiveRuleParamDto.groupByKey(dtos);
    assertThat(group).containsOnlyKeys("foo", "bar");
  }