@Test public void testInflateGroups_withPlainText() { doReturn(Optional.of("foo")).when(world).get("foo"); String value = inflater.inflateGroups("my {(foo)} is very {(bar)} !", Sets.newHashSet("foo", "bar")); assertThat(value, equalTo("my foo is very {(bar)} !")); }
String inflateGroups(String input, Set<String> groups) { String result = input; for (String key : groups) { Optional<String> $value = world.get(key); if ($value.isPresent()) { result = result.replaceAll("\\{\\(" + key + "\\)}", $value.get()); } } return result; }
ContextInflater extends BaseContextHandler { String inflateGroups(String input, Set<String> groups) { String result = input; for (String key : groups) { Optional<String> $value = world.get(key); if ($value.isPresent()) { result = result.replaceAll("\\{\\(" + key + "\\)}", $value.get()); } } return result; } }
ContextInflater extends BaseContextHandler { String inflateGroups(String input, Set<String> groups) { String result = input; for (String key : groups) { Optional<String> $value = world.get(key); if ($value.isPresent()) { result = result.replaceAll("\\{\\(" + key + "\\)}", $value.get()); } } return result; }  }
ContextInflater extends BaseContextHandler { String inflateGroups(String input, Set<String> groups) { String result = input; for (String key : groups) { Optional<String> $value = world.get(key); if ($value.isPresent()) { result = result.replaceAll("\\{\\(" + key + "\\)}", $value.get()); } } return result; }  String inflate(String input); }
ContextInflater extends BaseContextHandler { String inflateGroups(String input, Set<String> groups) { String result = input; for (String key : groups) { Optional<String> $value = world.get(key); if ($value.isPresent()) { result = result.replaceAll("\\{\\(" + key + "\\)}", $value.get()); } } return result; }  String inflate(String input);  }