### Question:
XHTMLMarkerResourceReferenceParser implements ResourceReferenceParser { @Override public ResourceReference parse(String rawReference) { String[] tokens = StringUtils.splitByWholeSeparatorPreserveAllTokens(rawReference, COMMENT_SEPARATOR); boolean isTyped = "true".equalsIgnoreCase(tokens[0]); ResourceType type = new ResourceType(tokens[1]); String reference = tokens[2]; ResourceReference resourceReference = new ResourceReference(reference, type); resourceReference.setTyped(isTyped); if (tokens.length == 4) { for (WikiParameter parameter : WikiParameters.newWikiParameters(tokens[3])) { resourceReference.setParameter(parameter.getKey(), parameter.getValue()); } } return resourceReference; }  @Override ResourceReference parse(String rawReference);  }### Answer:
@Test public void testParse() { ResourceReference expected = new ResourceReference("reference", ResourceType.DOCUMENT); expected.setParameter("param1", "value1"); expected.setParameter("param2", "value2"); Assert.assertEquals(expected, this.parser.parse("true|-|doc|-|reference|-|param1=value1 param2=value2")); }
@Test public void testParseWithEscapesInParameterValues() { ResourceReference expected = new ResourceReference("reference", ResourceType.DOCUMENT); expected.setParameter("param", "va\"l\\=ue"); ParametersPrinter printer = new ParametersPrinter('\\'); Assert.assertEquals(expected, this.parser.parse("true|-|doc|-|reference|-|" + printer.print("param", "va\"l\\=ue"))); }