title: How to deserialize a json array containing different types of objects
body: <p>Here is a json snippet which contains an array(icons) which can contain two different types of objects(application and folder)</p>
  <pre><code>{
    &quot;icons&quot;: [
      {
        &quot;application&quot;: {
          &quot;displayName&quot;: &quot;Facebook&quot;,
          &quot;bundleId&quot;: &quot;com.facebook.com&quot;
        }
      },
      {
        &quot;folder&quot;: {
          &quot;some&quot;: &quot;value&quot;,
          &quot;num&quot;: 3
        }
      }
    ]
  }
  </code></pre>
  <p>How can I create java POJO's modelling this kind of json and then deserialize the same?</p>
  <p>I referred to this <a href="https://stackoverflow.com/questions/14038084/json-nest-class-data-binding">question</a>. But I can't change the json I'm getting to include a 'type' as advised there and then use inheritance for the POJO's of the two different objects.</p>