### Question:
BasicConfigurationResolver implements CommandTaskInfo.ConfigurationResolver { @Override public List<CommandToken> apply(Map<String, String> configurations) { List<CommandToken> results = new ArrayList<>(); configurations.forEach((key, value) -> tokens.forEach(template -> { results.add(CommandToken.of(expand(template, key, value))); })); return results; } BasicConfigurationResolver(List<String> tokens);  BasicConfigurationResolver(String... tokens); List<String> getTokens(); @Override List<CommandToken> apply(Map<String, String> configurations);  }### Answer:
@Test public void simple() { Map<String, String> pairs = new LinkedHashMap<>(); pairs.put("a", "A"); pairs.put("b", "B"); pairs.put("c", "C"); ConfigurationResolver resolver = new BasicConfigurationResolver("${key}:${value}"); List<String> resolved = resolver.apply(pairs).stream() .map(CommandToken::getImage) .collect(Collectors.toList()); assertThat(resolved, contains("a:A", "b:B", "c:C")); }
@Test public void multiple_tokens() { Map<String, String> pairs = new LinkedHashMap<>(); pairs.put("a", "A"); pairs.put("b", "B"); pairs.put("c", "C"); ConfigurationResolver resolver = new BasicConfigurationResolver("-P", "${key}", "${value}"); List<String> resolved = resolver.apply(pairs).stream() .map(CommandToken::getImage) .collect(Collectors.toList()); assertThat(resolved, contains("-P", "a", "A", "-P", "b", "B", "-P", "c", "C")); }