title: Deserialization of Json string to complex Java Object
body: <p>I have such structure of object:</p>
  
  <pre><code>class A {
      List&lt;B&gt; bees;
  }
  
  class B {
      String с;
  }
  </code></pre>
  
  <p>I'm using Gson parser which serializes such object into this string:</p>
  
  <pre><code>{"a":{"bees":[{"с":"text"}]}}
  </code></pre>
  
  <p>(with adding a root element "a")</p>
  
  <p>API's format is a little bit different:</p>
  
  <pre><code>{"a":{"bees":[{"b":{"с":"text"}}]}}
  </code></pre>
  
  <p>I need to be able to parse such strings into A objects correctly.</p>
  
  <p>By default B object (as a part of A) becomes not null, but empty (all fields are null) which is understandable, cause parser doesn't find any field "b" in it (when it is actually a class name).</p>
  
  <p>I'm looking for a general solution for that, I have a lot of such complex objects and I don't want to implement many custom deserializers for each of them.</p>
  
  <p>Gson is not obligatory, I can use another lib if it's necessary.</p>
  
  <p>Thanks.</p>