docs: void unmarshallLifecycle(
              final Lifecycle lifecycle, final IPortletDefinition portletDefinition) {
  
          /*
           * If this is an existing portletDefinition, it may (probably does) already contain
           * lifecycle entries.  We need to remove those, because the lifecycle of a portlet after
           * import should reflect what the document says exactly.
           */
          portletDefinition.clearLifecycle();
  
          if (lifecycle == null) {
              /*
               * For backwards-compatibility, a complete absence of
               * lifecycle information means the portlet is published.
               */
              portletDefinition.updateLifecycleState(PortletLifecycleState.PUBLISHED, systemUser);
          } else if (lifecycle.getEntries().isEmpty()) {
              /*
               * According to the comments for 4.3, we're supposed
               * to leave the portlet in CREATED state.
               */
              portletDefinition.updateLifecycleState(PortletLifecycleState.CREATED, systemUser);
          } else {
              /*
               * Use a TreeMap because we need to be certain the the entries
               * get applied to the new portlet definition in a sane order...
               */
              Map<IPortletLifecycleEntry, IPerson> convertedEntries = new TreeMap<>();
              /*
               * Convert each LifecycleEntry (JAXB) to an IPortletLifecycleEntry (internal)
               */
              for (LifecycleEntry entry : lifecycle.getEntries()) {
                  final IPerson user =
                          StringUtils.isNotBlank(entry.getUser())
                                  ? userIdentityStore.getPerson(entry.getUser(), true)
                                  : systemUser; // default
                  // We will support case insensitivity of entry/@name in the XML
                  final PortletLifecycleState state =
                          PortletLifecycleState.valueOf(entry.getName().toUpperCase());
                  // Entries added by an upgrade transform will not have a date
                  final Date date =
                          entry.getValue().equals(useCurrentDatetimeSignal)
                                  ? new Date()
                                  : entry.getValue().getTime();
                  convertedEntries.put(
                          new IPortletLifecycleEntry() {
                              @Override
                              public int getUserId() {
                                  return user.getID();
                              }
  
                              @Override
                              public PortletLifecycleState getLifecycleState() {
                                  return state;
                              }
  
                              @Override
                              public Date getDate() {
                                  return date;
                              }
  
                              @Override
                              public int compareTo(IPortletLifecycleEntry o) {
                                  int rslt = date.compareTo(o.getDate());
                                  if (rslt == 0) {
                                      rslt = state.getOrder() - o.getLifecycleState().getOrder();
                                  }
                                  return rslt;
                              }
                          },
                          user);
              }
              /*
               * Apply them to the portlet definition
               */
              convertedEntries.forEach(
                      (k, v) -> {
                          portletDefinition.updateLifecycleState(
                                  k.getLifecycleState(), v, k.getDate());
                      });
          }
      }