code: @SuppressWarnings("null")
      // TODO: Too much code, improve this, possibly by breaking it
      public static final Object getObject(Object obj, String fieldName)
      {
          Field embeddedField;
          try
          {
              embeddedField = obj.getClass().getDeclaredField(fieldName);
              if (embeddedField != null)
              {
                  if (!embeddedField.isAccessible())
                  {
                      embeddedField.setAccessible(true);
                  }
                  Object embededObject = embeddedField.get(obj);
                  if (embededObject == null)
                  {
                      Class embeddedObjectClass = embeddedField.getType();
                      if (Collection.class.isAssignableFrom(embeddedObjectClass))
                      {
                          if (embeddedObjectClass.equals(List.class))
                          {
                              return new ArrayList();
                          }
                          else if (embeddedObjectClass.equals(Set.class))
                          {
                              return new HashSet();
                          }
                      }
                      else
                      {
                          embededObject = embeddedField.getType().newInstance();
                          embeddedField.set(obj, embededObject);
                      }
  
                  }
                  return embededObject;
              }
              else
              {
                  throw new PropertyAccessException("Embedded object not found: " + fieldName);
              }
  
          }
          catch (Exception e)
          {
              throw new PropertyAccessException(e);
          }
      }
docs: Gets the embedded object.
  
  @param obj
  the obj
  @param fieldName
  the field name
  @return the embedded object
  @throws PropertyAccessException
  the property access exception