public static void addContainerEnvsToExistingEnvs(Reconciliation reconciliation, List<EnvVar> existingEnvs, ContainerTemplate template) {
        if (template != null && template.getEnv() != null) {
            // Create set of env var names to test if any user defined template env vars will conflict with those set above
            Set<String> predefinedEnvs = new HashSet<>();
            for (EnvVar envVar : existingEnvs) {
                predefinedEnvs.add(envVar.getName());
            }

            // Set custom env vars from the user defined template
            for (ContainerEnvVar containerEnvVar : template.getEnv()) {
                if (predefinedEnvs.contains(containerEnvVar.getName())) {
                    AbstractModel.LOGGER.warnCr(reconciliation, "User defined container template environment variable {} is already in use and will be ignored",  containerEnvVar.getName());
                } else {
                    existingEnvs.add(createEnvVar(containerEnvVar.getName(), containerEnvVar.getValue()));
                }
            }
        }
    }
@Test
    public void testAddContainerToEnvVarsWithNullTemplate() {
        List<EnvVar> vars = new ArrayList<>();
        vars.add(new EnvVarBuilder().withName("VAR_1").withValue("value1").build());

        ContainerUtils.addContainerEnvsToExistingEnvs(Reconciliation.DUMMY_RECONCILIATION, vars, null);

        assertThat(vars.size(), is(1));
        assertThat(vars.get(0).getName(), is("VAR_1"));
        assertThat(vars.get(0).getValue(), is("value1"));
    }