@Test
    public void testIsRunning() {
        try (GenericContainer<?> container = new GenericContainer<>(TestImages.TINY_IMAGE).withCommand("top")) {
            assertThat(container.isRunning()).as("Container is not started and not running").isFalse();
            container.start();
            assertThat(container.isRunning()).as("Container is started and running").isTrue();
        }
    }
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