@Override
    public void printEnvironment(Map<String, String> environment, SecureEnvVarSpecifier secureEnvVarSpecifier) {
        safeOutputStreamConsumer.stdOutput("Environment variables: ");
        for (String key : environment.keySet()) {
            boolean secure = secureEnvVarSpecifier.isSecure(key);
            safeOutputStreamConsumer.stdOutput(String.format("Name= %s  Value= %s", key, secure ? MASK_VALUE : environment.get(key)));
        }
    }
@Test
    public void shouldPrintEnvironmentVars() {
        Map<String, String> env = new HashMap<>();
        Console.SecureEnvVarSpecifier varSpecifier = mock(Console.SecureEnvVarSpecifier.class);
        for (int i = 0; i < keys.size(); i++) {
            env.put(keys.get(i), values.get(i));
            when(varSpecifier.isSecure(keys.get(i))).thenReturn(i % 2 == 0);
        }
        doNothing().when(safeOutputStreamConsumer).stdOutput("Environment variables: ");
        for (int i = 0; i < keys.size(); i++) {
            doNothing().when(safeOutputStreamConsumer).stdOutput(
                    String.format("Name= %s  Value= %s", keys.get(i),
                            i % 2 == 0 ? PluggableTaskConsole.MASK_VALUE : values.get(i)));
        }
        console.printEnvironment(env, varSpecifier);
        verify(safeOutputStreamConsumer).stdOutput("Environment variables: ");
        for (int i = 0; i < keys.size(); i++) {
            verify(varSpecifier).isSecure(keys.get(i));
            verify(safeOutputStreamConsumer).stdOutput(String.format("Name= %s  Value= %s", keys.get(i),
                    i % 2 == 0 ? PluggableTaskConsole.MASK_VALUE : values.get(i)));
        }
    }