Source:
public String getCorePropertiesText() { POIXMLDocument document = getDocument(); if (document == null) { return ""; } StringBuilder text = new StringBuilder(64); PackagePropertiesPart props = document.getProperties().getCoreProperties().getUnderlyingProperties(); appendIfPresent(text, "Category", props.getCategoryProperty()); appendIfPresent(text, "Category", props.getCategoryProperty()); appendIfPresent(text, "ContentStatus", props.getContentStatusProperty()); appendIfPresent(text, "ContentType", props.getContentTypeProperty()); appendIfPresent(text, "Created", props.getCreatedProperty().orElse(null)); appendIfPresent(text, "CreatedString", props.getCreatedPropertyString()); appendIfPresent(text, "Creator", props.getCreatorProperty()); appendIfPresent(text, "Description", props.getDescriptionProperty()); appendIfPresent(text, "Identifier", props.getIdentifierProperty()); appendIfPresent(text, "Keywords", props.getKeywordsProperty()); appendIfPresent(text, "Language", props.getLanguageProperty()); appendIfPresent(text, "LastModifiedBy", props.getLastModifiedByProperty()); appendIfPresent(text, "LastPrinted", props.getLastPrintedProperty().orElse(null)); appendIfPresent(text, "LastPrintedString", props.getLastPrintedPropertyString()); appendIfPresent(text, "Modified", props.getModifiedProperty().orElse(null)); appendIfPresent(text, "ModifiedString", props.getModifiedPropertyString()); appendIfPresent(text, "Revision", props.getRevisionProperty()); appendIfPresent(text, "Subject", props.getSubjectProperty()); appendIfPresent(text, "Title", props.getTitleProperty()); appendIfPresent(text, "Version", props.getVersionProperty()); return text.toString(); }

Target:
public String getCorePropertiesText() { POIXMLDocument document = getDocument(); if (document == null) { return ""; } StringBuilder text = new StringBuilder(64); PackagePropertiesPart props = document.getProperties().getCoreProperties().getUnderlyingProperties(); appendIfPresent(text, "Category", props.getCategoryProperty()); appendIfPresent(text, "Category", props.getCategoryProperty()); appendIfPresent(text, "ContentStatus", props.getContentStatusProperty()); appendIfPresent(text, "ContentType", props.getContentTypeProperty()); appendDateIfPresent(text, "Created", props.getCreatedProperty()); appendIfPresent(text, "CreatedString", props.getCreatedPropertyString()); appendIfPresent(text, "Creator", props.getCreatorProperty()); appendIfPresent(text, "Description", props.getDescriptionProperty()); appendIfPresent(text, "Identifier", props.getIdentifierProperty()); appendIfPresent(text, "Keywords", props.getKeywordsProperty()); appendIfPresent(text, "Language", props.getLanguageProperty()); appendIfPresent(text, "LastModifiedBy", props.getLastModifiedByProperty()); appendDateIfPresent(text, "LastPrinted", props.getLastPrintedProperty()); appendIfPresent(text, "LastPrintedString", props.getLastPrintedPropertyString()); appendDateIfPresent(text, "Modified", props.getModifiedProperty()); appendIfPresent(text, "ModifiedString", props.getModifiedPropertyString()); appendIfPresent(text, "Revision", props.getRevisionProperty()); appendIfPresent(text, "Subject", props.getSubjectProperty()); appendIfPresent(text, "Title", props.getTitleProperty()); appendIfPresent(text, "Version", props.getVersionProperty()); return text.toString(); }