### Question:
LanePropertyReader extends BasePropertyReader { public String getName() { String extendedName = CustomElement.name.of(element).get(); return extendedName.isEmpty() ? Optional.ofNullable(lane.getName()).orElse("") : extendedName; } LanePropertyReader(Lane el, BPMNDiagram diagram, BPMNShape shape, BPMNShape parentLaneShape, double resolutionFactor);  LanePropertyReader(Lane el, BPMNDiagram diagram, BPMNShape shape, double resolutionFactor); String getName(); @Override RectangleDimensionsSet getRectangleDimensionsSet();  }### Answer:
@Test public void JBPM_7523_shouldPreserveNameChars() { PropertyReaderFactory factory = new PropertyReaderFactory( new TestDefinitionsWriter().getDefinitionResolver()); Lane lane = bpmn2.createLane(); PropertyWriterFactory writerFactory = new PropertyWriterFactory(); LanePropertyWriter w = writerFactory.of(lane); String aWeirdName = " XXX !!@@ <><> "; String aWeirdDoc = " XXX !!@@ <><> Docs "; w.setName(aWeirdName); w.setDocumentation(aWeirdDoc); LanePropertyReader r = factory.of(lane); assertThat(r.getName()).isEqualTo(asCData(aWeirdName)); assertThat(r.getDocumentation()).isEqualTo(asCData(aWeirdDoc)); }
@Test public void testGetNameFromExtensionElement() { List<ExtensionAttributeValue> extensionValues = mockExtensionValues(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, METADATA_ELEMENT_NAME, NAME); when(lane.getName()).thenReturn(null); when(lane.getExtensionValues()).thenReturn(extensionValues); LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); assertEquals(NAME, propertyReader.getName()); }
@Test public void testGetNameFromNameValue() { LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); when(lane.getExtensionValues()).thenReturn(null); when(lane.getName()).thenReturn(NAME); assertEquals(NAME, propertyReader.getName()); }
@Test public void testGetNameFromExtensionElement() { EList<ExtensionAttributeValue> extensionValues = mockExtensionValues(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, METADATA_ELEMENT_NAME, NAME); when(lane.getName()).thenReturn(null); when(lane.getExtensionValues()).thenReturn(extensionValues); LanePropertyReader propertyReader = new LanePropertyReader(lane, diagram, shape, RESOLUTION_FACTOR); assertEquals(NAME, propertyReader.getName()); }