@@ -0,0 +1,2169 @@
+#set( $symbol_pound = '#' )%0A#set( $symbol_dollar = '$' )%0A#set( $symbol_escape = '%5C' )%0Apackage $%7Bpackage%7D;%0A%0Aimport org.junit.Test;%0A%0Aimport java.io.PrintWriter;%0Aimport java.io.StringWriter;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.hamcrest.Matchers.nullValue;%0A%0Apublic class MessagesTest %7B%0A%0A  @Test%0A  public void malformedKeyAndPairReturnsNull() %7B%0A    assertThat(Messages.parseKeyValuePair(%22blah%22), nullValue());%0A  %7D%0A%0A  @Test%0A  public void canParseFormattedKeyAndValuePair() %7B%0A    String key = %22testKey%22;%0A    String value = %22testValue%22;%0A    String formatted = Messages.formatKeyValuePair(key, value);%0A    Map.Entry%3CString, String%3E parsed = Messages.parseKeyValuePair(formatted);%0A    assertThat(parsed.getKey(), equalTo(key));%0A    assertThat(parsed.getValue(), equalTo(value));%0A  %7D%0A%0A  @Test%0A  public void canParseFormattedKeyValueWithoutLeadingSpaces() %7B%0A    String key = %22testKey%22;%0A    String value = %22testValue%22;%0A    String formatted = Messages.formatKeyValuePair(key, value);%0A    String trimmed = formatted.trim();%0A    Map.Entry%3CString, String%3E parsed = Messages.parseKeyValuePair(trimmed);%0A    assertThat(parsed.getKey(), equalTo(key));%0A    assertThat(parsed.getValue(), equalTo(value));%0A%0A  %7D%0A%0A  @Test%0A  public void nullValueIsParsedAsNull() %7B%0A    String key = %22testKey%22;%0A    String value = null;%0A    String formatted = Messages.formatKeyValuePair(key, value);%0A    Map.Entry%3CString, String%3E parsed = Messages.parseKeyValuePair(formatted);%0A    assertThat(parsed.getKey(), equalTo(key));%0A    assertThat(parsed.getValue(), equalTo(value));%0A  %7D%0A%0A  @Test%0A  public void canParseFormattedKeyValueMap() %7B%0A    Map%3CString, String%3E map = new HashMap%3C%3E();%0A%0A    for (int i = 0; i %3C 5; i++) %7B%0A      String key = String.valueOf(i);%0A      String value = %22QQ%22 + key;%0A      map.put(key, value);%0A    %7D%0A%0A    StringWriter sw = new StringWriter();%0A    Messages.formatKeyValueMap(new PrintWriter(sw, true), map);%0A%0A    String formatted = sw.toString();%0A%0A    Map%3CString, String%3E actual = Messages.parseKeyValueMap(formatted);%0A    assertThat(actual, equalTo(map));%0A  %7D%0A%7D%0A

Add test for Messages class.