public void testReplaceWithReferenceField() {
try {
search = new TextNavigation("ReplaceReferenceTarget", doc);
TextSpanElement newTextSpanElement = doc.newParagraph("Selection Reference Content:").newTextSpanElement();
newTextSpanElement.setTextContent("This is a test selection reference content.");
ReferenceField referenceField = Fields.createReferenceField(newTextSpanElement, "selection-test-ref");
// count the initial reference field count.
OdfContentDom contentDom = doc.getContentDom();
NodeList nodeList = contentDom.getElementsByTagName(TextReferenceRefElement.ELEMENT_NAME.getQName());
int i = nodeList.getLength();
OdfStylesDom styleDom = doc.getStylesDom();