### Question:
MetaDataEditorFieldRenderer extends FieldRenderer<MetaDataEditorFieldDefinition, DefaultFormGroup> implements MetaDataEditorWidgetView.Presenter { @Override public List<MetaDataRow> deserializeMetaDataAttributes(final String s) { List<MetaDataRow> attributeRows = new ArrayList<>(); if (s != null && !s.isEmpty()) { String[] vs = s.split(DELIMITER); for (String v : vs) { if (!v.isEmpty()) { MetaDataAttribute att = MetaDataAttribute.deserialize(v); if (null != att.getAttribute() && !att.getAttribute().isEmpty()) { attributeRows.add(new MetaDataRow(att)); } } } } return attributeRows; } @Inject  MetaDataEditorFieldRenderer(final MetaDataEditorWidgetView metaDataEditor,
                                       final SessionManager sessionManager,
                                       final ErrorPopupPresenter errorPopupPresenter,
                                       final Event<NotificationEvent> notification); @Override String getName(); @Override void doSave(); @Override void addAttribute(); @Override void notifyModelChanged(); @Override List<MetaDataRow> deserializeMetaDataAttributes(final String s); @Override String serializeMetaDataAttributes(final List<MetaDataRow> metaDataRows); @Override boolean isDuplicateAttribute(final String attribute); @Override void removeMetaData(final MetaDataRow metaDataRow); @Override Path getDiagramPath(); @Override void showErrorMessage(String message);  }### Answer:
@Test public void testDeserializeMetaData() { List<MetaDataRow> metaDataRows = metaDataEditor.deserializeMetaDataAttributes("att1ßval1Øatt2ßval2Øatt3ßval3,val4"); assertEquals(3, metaDataRows.size()); MetaDataRow att = metaDataRows.get(0); assertEquals("att1", att.getAttribute()); assertEquals("val1", att.getValue()); att = metaDataRows.get(1); assertEquals("att2", att.getAttribute()); assertEquals("val2", att.getValue()); att = metaDataRows.get(2); assertEquals("att3", att.getAttribute()); assertEquals("val3,val4", att.getValue()); }
@Test public void testDeserializeMetaDataPermutations() { List<MetaDataRow> metaDataRows = metaDataEditor.deserializeMetaDataAttributes(null); assertEquals(0, metaDataRows.size()); List<MetaDataRow> metaDataRows2 = metaDataEditor.deserializeMetaDataAttributes(""); assertEquals(0, metaDataRows2.size()); List<MetaDataRow> metaDataRows3 = metaDataEditor.deserializeMetaDataAttributes("ßvalue"); assertEquals(0, metaDataRows3.size()); List<MetaDataRow> metaDataRows4 = metaDataEditor.deserializeMetaDataAttributes("att1ßval1Øatt2"); assertEquals(2, metaDataRows4.size()); List<MetaDataRow> metaDataRows5 = metaDataEditor.deserializeMetaDataAttributes("att1ßval1Øatt2Øatt3ßval3,val4"); assertEquals(3, metaDataRows5.size()); List<MetaDataRow> metaDataRows6 = metaDataEditor.deserializeMetaDataAttributes("att1ßval1Øatt2Øßval3,val4"); assertEquals(2, metaDataRows6.size()); List<MetaDataRow> metaDataRows7 = metaDataEditor.deserializeMetaDataAttributes("ßØØatt1ßvall"); assertEquals(1, metaDataRows7.size()); List<MetaDataRow> metaDataRows8 = metaDataEditor.deserializeMetaDataAttributes("ßØØßvall"); assertEquals(0, metaDataRows8.size()); }