### Question:
TextUtil { public static String templateString( String templateString, Map<String, ?> data ) { return templateString( templateString, "\\$", data ); } private  TextUtil(); static String templateString( String templateString,
            Map<String, ?> data ); static String templateString( String templateString,
            String variablePrefix, Map<String, ?> data ); static String lastWordOrQuoteOf( String text, boolean preserveQuotation ); static String[] tokenizeStringWithQuotes( String string ); static String[] tokenizeStringWithQuotes( String string, boolean trim, boolean preserveEscapeCharacters ); static String[] tokenizeStringWithQuotes( String string, boolean trim, boolean preserveEscapeCharacters, boolean preserveSpaceEscapeCharacters );  }### Answer:
@Test void shouldReplaceVariablesWithValuesInTemplateString() { String template = "This is a $FIRST that $SECOND $THIRD!"; Map<String,String> values = new HashMap<>(); values.put( "FIRST", "String" ); values.put( "SECOND", "should" ); values.put( "THIRD", "act as a template!" ); String string = TextUtil.templateString( template, values ); assertEquals( "This is a String that should act as a template!!", string ); }