title: Java get bean value
body: <p>Given the following:</p>
  
  <pre><code>public class Person {
      private Car car;
      // .. bean stuff
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>public class Car {
      private CarStuff carStuff;
      // .. bean stuff
  }
  </code></pre>
  
  <p>I can use BeanUtils to set the "car" property of Person:</p>
  
  <pre><code>BeanUtils.setProperty(person, "car", theirCar);
  </code></pre>
  
  <p>Ok that was super easy. Now how do I get "car" out by its name?</p>
  
  <pre><code>BeanUtils.getProperty(person, "car")
  </code></pre>
  
  <p>Will return a String, but Car is not a String</p>
  
  <p>I have tried:</p>
  
  <pre><code>Map&lt;String, ? extends Object&gt; props = new HashMap&lt;&gt;();
  BeanUtils.populate(person, props);
  </code></pre>
  
  <p>but there is no "car" entry, and investigating the documentation, the output (while promisingly of type Object) would still be either String or String[]</p>
  
  <p>My classes all have proper bean getter and setter methods. How can I obtain the value?</p>