title: Translating nested Java objects to/from json using gson
body: <p>Let's assume we have the following two Java Classes (omitting the other class members):</p>
  
  <pre><code>class Book {
      private String name;
      private String[] tags;
      private int price;
      private Author author;
  }
  
  class Author {
      private String name;
  }
  </code></pre>
  
  <p>Furthermore, assume we have the following json object:</p>
  
  <pre><code>{"Book": {
      "name": "Bible",
      "price": 20,
      "tags": ["God", "Religion"],
      "writer": {
          "name": "Jesus"
      }
  }
  </code></pre>
  
  <p>I am trying to find the best way to convert a Java Book instance to json and back using gson. To make the example more interesting, note that in json, I want to use "writer" instead of "Author". Can you please help? Ideally, I would like to see a complete implementation. </p>