title: Parsing JSON with Java from a dictionary api
body: <p>Very new to JSON. Using json-lib for this and been pulling my hair out trying to get "definitions" from this JSON response by Oxford Dictionaries API. Tried all sorts of things. But can never get anything more specific than everything from "results". Would like to figure out why this is so difficult otherwise will just resort to regex. </p>
  
  <pre><code>        JSONObject obj = new JSONObject(stringBuilder.toString());
  
          JSONArray arr = obj.getJSONArray("results");
          String test = arr.getJSONObject(1).toString(); // Empty wtf? 
          String definition = obj.getString("definitions"); // empty also...
  </code></pre>
  
  <p>Managed to also access "id", "language" and "lexicalEntries" separately, but anything beyond that doesn't seem to want to cooperate.... Is this a normal JSON response? It's quite awkward no? Thanks...</p>
  
  <p>JSON:      </p>
  
  <pre><code>{
    "metadata": {
      "provider": "Oxford University Press"
    },
    "results": [
      {
        "id": "ace",
        "language": "en",
        "lexicalEntries": [
          {
            "entries": [
              {
                "homographNumber": "000",
                "senses": [
                  {
                    "definitions": [
                      "a playing card with a single spot on it, ranked as the highest card in its suit in most card games"
                    ],
                    "id": "m_en_gbus0005680.006"
                  },
                  {
                    "definitions": [
                      "a person who excels at a particular sport or other activity"
                    ],
                    "id": "m_en_gbus0005680.010",
                    "subsenses": [
                      {
                        "definitions": [
                          "a pilot who has shot down many enemy aircraft"
                        ],
                        "id": "m_en_gbus0005680.011"
                      }
                    ]
                  },
                  {
                    "definitions": [
                      "(in tennis and similar games) a service that an opponent is unable to return and thus wins a point"
                    ],
                    "id": "m_en_gbus0005680.013",
                    "subsenses": [
                      {
                        "definitions": [
                          "a hole in one"
                        ],
                        "id": "m_en_gbus0005680.014"
                      }
                    ]
                  }
                ]
              }
            ],
            "language": "en",
            "lexicalCategory": "Noun",
            "text": "ace"
          },
          {
            "entries": [
              {
                "homographNumber": "001",
                "senses": [
                  {
                    "definitions": [
                      "very good"
                    ],
                    "id": "m_en_gbus0005680.016"
                  }
                ]
              }
            ],
            "language": "en",
            "lexicalCategory": "Adjective",
            "text": "ace"
          },
          {
            "entries": [
              {
                "homographNumber": "002",
                "senses": [
                  {
                    "definitions": [
                      "(in tennis and similar games) serve an ace against (an opponent)"
                    ],
                    "id": "m_en_gbus0005680.020",
                    "subsenses": [
                      {
                        "definitions": [
                          "score an ace on (a hole) or with (a shot)"
                        ],
                        "id": "m_en_gbus0005680.026"
                      }
                    ]
                  },
                  {
                    "definitions": [
                      "achieve high marks in (a test or exam)"
                    ],
                    "id": "m_en_gbus0005680.028",
                    "subsenses": [
                      {
                        "definitions": [
                          "outdo someone in a competitive situation"
                        ],
                        "id": "m_en_gbus0005680.029"
                      }
                    ]
                  }
                ]
              }
            ],
            "language": "en",
            "lexicalCategory": "Verb",
            "text": "ace"
          }
        ],
        "type": "headword",
        "word": "ace"
      }
    ]
  }
  </code></pre>