LimitRateConfig extends Config { @Override protected void validate() { if (!rateControlGroupAdded) { throw new Error("limitRate is configured but no group added, please remove unnecessary config"); } }  void add(String group, int maxPermits, int fillRate, TimeUnit unit);  }
@Test void validate() { assertThatThrownBy(() -> config.validate()) .hasMessageContaining("limitRate is configured but no group added"); }