@Test
    public void exceptionThrownWhenMappedPortNotFound() {
        assertThat(catchThrowable(() -> redis.getMappedPort(666)))
            .as("When the requested port is not mapped, getMappedPort() throws an exception")
            .isInstanceOf(IllegalArgumentException.class);
    }
Create a container with an extra host entry and expose the content of /etc/hosts for testing.
core/src/test/java/org/testcontainers/junit/GenericContainerRuleTest.java