title: How to get all classes that "participate" in a given object?
body: <p>I have a java object, an instance of class <code>Object</code> - that's all I know about it. Now I need to create a list of <code>Class</code>-es that took participation in its creation, including its own class, all parent classes, all classes of its properties and methods. For example:</p>
  
  <pre><code>List obj = new ArrayList();
  obj.add(new Integer(4));
  obj.add(new Foo());
  System.out.println(allRelatedClasses(obj));
  </code></pre>
  
  <p>Should output something like this:</p>
  
  <pre><code>Object, List, Collection, Iterable, Serializable, Cloneable, RandomAccess, 
  ArrayList, Integer, Foo
  </code></pre>
  
  <p>Is it possible at all?</p>