@Test
    void singleHazelcastContainer() {
        try (
            GenericContainer<?> container = new GenericContainer<>(DockerImageName.parse(HZ_IMAGE_NAME))
                .withExposedPorts(DEFAULT_EXPOSED_PORT)
        ) {
            container.start();
            assertThat(container.isRunning()).isTrue();

            ClientConfig clientConfig = new ClientConfig();
            clientConfig
                .getNetworkConfig()
                .addAddress(container.getHost() + HOST_PORT_SEPARATOR + container.getFirstMappedPort());
            HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig);

            BlockingQueue<String> queue = client.getQueue(TEST_QUEUE_NAME);
            queue.put(TEST_VALUE);
            assertThat(queue.take()).isEqualTo(TEST_VALUE);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException("Interrupted during singleHazelcastContainer test", e);
        }
    }
Examples with Hazelcast using both a single container and a cluster with two containers.
examples/hazelcast/src/test/java/org/testcontainers/examples/HazelcastTest.java