static List<String> substituteVariables(List<String> line, Map<String, String> vars) {
        return line.stream().map(s -> PulsarShell.substituteVariables(s, vars)).collect(Collectors.toList());
    }
@Test
    public void testSubstituteVariables() throws Exception {
        Map<String, String> vars = new HashMap<>();
        vars.put("mytopic", "the-topic");
        assertEquals(
                PulsarShell.substituteVariables(Arrays.asList("admin", "topics", "create", "${mytopic}"), vars),
                Arrays.asList("admin", "topics", "create", "the-topic")
        );
        assertEquals(
                PulsarShell.substituteVariables(Arrays.asList("admin", "topics", "create", "\\${mytopic}"), vars),
                Arrays.asList("admin", "topics", "create", "${mytopic}")
        );
        assertEquals(
                PulsarShell.substituteVariables(Arrays.asList("admin", "topics", "create", "${MYTOPIC}"), vars),
                Arrays.asList("admin", "topics", "create", "${MYTOPIC}")
        );
        assertEquals(
                PulsarShell.substituteVariables(Arrays.asList("admin", "topics", "create", "$mytopic"), vars),
                Arrays.asList("admin", "topics", "create", "the-topic")
        );
        assertEquals(
                PulsarShell.substituteVariables(Arrays.asList("admin", "topics", "create", "\\$mytopic"), vars),
                Arrays.asList("admin", "topics", "create", "$mytopic")
        );

    }