@Test
public void withMultipleClientsRespectsMaxLogSize() throws InterruptedException {

    new TestKit(actorSystem) {{
        final TestProbe sender = TestProbe.apply(actorSystem);
        final Connection connection = createConnectionWithClients(3);
        final Instant since = Instant.now().minusSeconds(333);
        final Instant until = Instant.now().plusSeconds(555);
        final Collection<RetrieveConnectionLogsResponse> responses = Arrays.asList(
                createRetrieveConnectionLogsResponse(connection.getId(), since, until, maxSizeLogEntries()),
                createRetrieveConnectionLogsResponse(connection.getId(), since, until, maxSizeLogEntries()),
                createRetrieveConnectionLogsResponse(connection.getId(), since, until, maxSizeLogEntries())
        );
        final ActorRef underTest = childActorOf(
                RetrieveConnectionLogsAggregatorActor.props(connection, sender.ref(), DITTO_HEADERS,
                        DEFAULT_TIMEOUT, LOGGER_CONFIG.maxLogSizeInBytes()));
        responses.forEach(response -> underTest.tell(response, getRef()));
        final RetrieveConnectionLogsResponse retrieveConnectionLogsResponse =
                sender.expectMsgClass(RetrieveConnectionLogsResponse.class);
        assertThat((Long) retrieveConnectionLogsResponse.getConnectionLogs().stream()
                .map(LogEntry::toJsonString)
                .map(String::length)
                .mapToLong(Integer::intValue)
                .sum())
                .isLessThan(LOGGER_CONFIG.maxLogSizeInBytes());
    }};
}