@Test
public void withTimeoutWithMessages() {

    new TestKit(actorSystem) {{
        final TestProbe sender = TestProbe.apply(actorSystem);
        final Duration aggregatorTimeout = Duration.ofSeconds(5);
        final FiniteDuration expectMessageTimeout =
                FiniteDuration.apply(aggregatorTimeout.getSeconds() + 1, TimeUnit.SECONDS);
        // create connection with more clients than responses
        final Connection connection = createConnectionWithClients(2);
        final ActorRef underTest = childActorOf(
                RetrieveConnectionLogsAggregatorActor.props(connection, sender.ref(), DITTO_HEADERS,
                        aggregatorTimeout, LOGGER_CONFIG.maxLogSizeInBytes()));
        // only send one response
        final RetrieveConnectionLogsResponse expectedResponse =
                createRetrieveConnectionLogsResponse(connection.getId(), Instant.now().minusSeconds(123),
                        Instant.now().plusSeconds(444));
        underTest.tell(expectedResponse, getRef());
        // expect that known response will be sent, ignoring missing responses
        sender.expectMsg(expectMessageTimeout, expectedResponse);
    }};
}