### Question:
TitleAndNodeNameDefinitionBuilderImpl implements ResourceDefinitionBuilder { @Override public final ResourceDefinition convert(String data) { data = StringUtils.stripToEmpty(data); String name; final Matcher matcher = PATTERN.matcher(data); if (matcher.find() && matcher.groupCount() == 1) { name = matcher.group(1); name = StringUtils.stripToEmpty(name); } else { return null; } String title = PATTERN.matcher(data).replaceAll(""); title = StringUtils.stripToEmpty(title); final BasicResourceDefinition dataDefinition = new BasicResourceDefinition(name); dataDefinition.setTitle(title); return dataDefinition; }  @Override final ResourceDefinition convert(String data); @Override boolean accepts(String data); static final String NAME; }### Answer:
@Test public void testConvert() throws Exception { String expectedTitle = "Hello World"; String expectedName = "hello-world"; ResourceDefinition actual = builder.convert("Hello World {{ hello-world }}"); assertEquals(expectedTitle, actual.getTitle()); assertEquals(expectedName, actual.getName()); }