code: private Object saveMap(FacesContext context, Map<Serializable, Object> map) {
  
          if (map.isEmpty()) {
              if (!component.initialStateMarked()) {
                  // only need to propagate the component's delta status when
                  // delta tracking has been disabled.  We're assuming that
                  // the VDL will reset the status when the view is reconstructed,
                  // so no need to save the state if the saved state is the default.
                  return new Object[] { component.initialStateMarked() };
              }
              return null;
          }
  
          Object[] savedState = new Object[map.size() * 2 + 1];
  
          int i=0;
  
          for(Map.Entry<Serializable, Object> entry : map.entrySet()) {
              Object value = entry.getValue();
              savedState[i * 2] = entry.getKey();
              if (value instanceof Collection
                    || value instanceof StateHolder
                    || value instanceof Map
                    || !(value instanceof Serializable)) {
                  value = saveAttachedState(context,value);
              }
              savedState[i * 2 + 1] = value;
              i++;
          }
          if (!component.initialStateMarked()) {
              savedState[savedState.length - 1] = component.initialStateMarked();
          }
          return savedState;
  
      }
docs: --------------------------------------------------------- Private Methods