### Question:
TextAnnotationConverter { public PropertyWriter toElement(Node<View<TextAnnotation>, ?> node) { final TextAnnotation def = node.getContent().getDefinition(); if (def != null) { TextAnnotation definition = node.getContent().getDefinition(); org.eclipse.bpmn2.TextAnnotation element = bpmn2.createTextAnnotation(); element.setId(node.getUUID()); TextAnnotationPropertyWriter writer = propertyWriterFactory.of(element); BPMNGeneralSet general = definition.getGeneral(); writer.setName(general.getName().getValue()); writer.setDocumentation(general.getDocumentation().getValue()); writer.setAbsoluteBounds(node); return writer; } return ConverterUtils.notSupported(def); } TextAnnotationConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<TextAnnotation>, ?> node);  }### Answer:
@Test public void toElement() { PropertyWriter propertyWriter = tested.toElement(node); verify(writer).setName(NAME); verify(writer).setDocumentation(DOC); verify(writer).setAbsoluteBounds(node); assertEquals(writer, propertyWriter); }
@Test(expected = NullPointerException.class) public void toElementWithNullValue() { when(textAnnotationView.getDefinition()).thenReturn(null); PropertyWriter propertyWriter = tested.toElement(node); }