public static boolean exceedsPersistentQueryCapacity(
      final KsqlExecutionContext executionContext,
      final KsqlConfig ksqlConfig
  ) {
    return executionContext.getPersistentQueries().size() > getQueryLimit(ksqlConfig);
  }
@Test
  public void shouldReportCapacityExceededIfOverLimit() {
    // Given:
    givenActivePersistentQueries(4);
    givenQueryLimit(2);

    // Then:
    assertThat(QueryCapacityUtil.exceedsPersistentQueryCapacity(ksqlEngine, ksqlConfig),
        equalTo(true));
  }