public static String substitute(
      final String string,
      final Map<String, String> valueMap
  ) {
    return StringSubstitutor.replace(
        string, valueMap.entrySet().stream()
            .collect(Collectors.toMap(e -> e.getKey(), e -> sanitize(e.getValue())))
    );
  }
@Test
  public void shouldSubstituteVariablesInString() {
    // Given
    final Map<String, String> variablesMap = new ImmutableMap.Builder<String, String>() {{
      put("event", "birthday");
    }}.build();

    // When
    final String substituted = VariableSubstitutor.substitute("Happy ${event} to you!", variablesMap);

    // Then
    assertThat(substituted, equalTo("Happy birthday to you!"));
  }