code: private void setRelationToEntity(Object entity, Object relationEntity, Relation relation)
      {
          if (relation.getTargetEntity().isAssignableFrom(getEntity(relationEntity).getClass()))
          {
  
              if (relation.isUnary())
              {
                  PropertyAccessorHelper.set(entity, relation.getProperty(), getEntity(relationEntity));
              }
              else
              {
                  Object associationObject = PropertyAccessorHelper.getObject(entity, relation.getProperty());
                  if (associationObject == null || ProxyHelper.isProxyOrCollection(associationObject))
                  {
                      associationObject = PropertyAccessorHelper.getCollectionInstance(relation.getProperty());
                      PropertyAccessorHelper.set(entity, relation.getProperty(), associationObject);
                  }
  
                  ((Collection) associationObject).add(getEntity(relationEntity));
              }
          }
      }
docs: After successfully parsing set relational entity object within entity
  object.
  
  @param entity
  @param relationEntity
  @param relation