code: public NodeKey getParentKey( Document document,
                                   String primaryWorkspaceKey,
                                   String secondaryWorkspaceKey ) {
          Object value = document.get(PARENT);
          return keyFrom(value, primaryWorkspaceKey, secondaryWorkspaceKey);
      }
docs: Obtain the preferred {@link NodeKey key} for the parent of this node. Because a node can be used in more than once place,
  it may technically have more than one parent. Therefore, in such cases this method prefers the parent that is in the
  {@code primaryWorkspaceKey} and, if there is no such parent, the parent that is in the {@code secondaryWorkspaceKey}.
  
  @param document the document for the node; may not be null
  @param primaryWorkspaceKey the key for the workspace in which the parent should preferably exist; may be null
  @param secondaryWorkspaceKey the key for the workspace in which the parent should exist if not in the primary workspace;
  may be null
  @return the key representing the preferred parent, or null if the document contains no parent reference or if the parent
  reference(s) do not have the specified workspace keys