class ServiceConnections {

	private static final String GENERIC_CONTAINER_CLASS_NAME = "org.testcontainers.containers.GenericContainer";

	private final Map<String, ServiceConnection> connectionsById = new HashMap<>();

	public void addServiceConnection(ServiceConnection serviceConnection) {<FILL_FUNCTION_BODY>}

	public Stream<ServiceConnection> values() {
		return this.connectionsById.values().stream().sorted(Comparator.comparing(ServiceConnection::id));
	}

	public record ServiceConnection(String id, DockerService dockerService, String containerClassName,
			boolean containerClassNameGeneric, String connectionName) {

		public static ServiceConnection ofGenericContainer(String id, DockerService dockerService,
				String connectionName) {
			return new ServiceConnection(id, dockerService, GENERIC_CONTAINER_CLASS_NAME, true, connectionName);
		}

		public static ServiceConnection ofContainer(String id, DockerService dockerService, String containerClassName) {
			return ofContainer(id, dockerService, containerClassName, true);
		}

		public static ServiceConnection ofContainer(String id, DockerService dockerService, String containerClassName,
				boolean containerClassNameGeneric) {
			return new ServiceConnection(id, dockerService, containerClassName, containerClassNameGeneric, null);
		}

		public boolean isGenericContainer() {
			return this.containerClassName.equals(GENERIC_CONTAINER_CLASS_NAME);
		}

	}

}

		String id = serviceConnection.id();
		if (this.connectionsById.containsKey(id)) {
			throw new IllegalArgumentException("Connection with id '" + id + "' already registered");
		}
		this.connectionsById.put(id, serviceConnection);
	
<no_super_class>