code: public void merge(Object obj, PropertyList properties) {
          if (obj == null) {
              throw new IllegalArgumentException(
                      "Object to merge cannot be null");
          }
  
          for (PropertySpec property : properties) {
              String name = property.getName();
              Object value = property.getValue(obj);
  
              if (value != null && property.getPropertyList() != null) {
                  if (value instanceof Collection) {
                      List colValues = new ArrayList(((Collection) value).size());
                      for (Object o : (Collection) value) {
                          colValues.add(new DynamicObject(o,
                                                          property.getPropertyList()));
                      }
                      value = colValues;
                  }
                  else {
                      value = new DynamicObject(value,
                                                property.getPropertyList());
                  }
              }
  
              m_properties.put(name, value);
          }
      }
docs: Merge specified properties from the specified object into this one.
  <p/>
  Any properties with the same name that already exist in this object will be overwritten.
  
  @param obj        object to merge into this object
  @param properties properties to merge