title: Parsing Json Array resulting in This is not a JSON Array exception
body: <p>I am trying to parse a Json array which looks like this:</p>
  
  <pre><code>{
    "FoodItemData": [
        {
          "country": "GB",
          "id": "100",
          "name": "Steak and Kidney Pie",
          "description": "Tender cubes of steak, with tender lamb kidney is succulent rich gravy.  Served with a side of mashed potatoes and peas.",
          "category": "Dinner",
          "price": "15.95"
        },
        {
          "country": "GB",
          "id": "101",
          "name": "Toad in the Hole",
          "description": "Plump British Pork sausages backed in a light batter.  Served with mixed vegetables and a brown onion gravy.",
          "category": "Dinner",
          "price": "13.95"
        },
        {
          "country": "GB",
          "id": "102",
          "name": "Ploughmanâ€™s Salad",
          "description": "Pork Pie, Pickled Onions, Pickled relish Stilton and Cheddar cheeses and crusty French bread.",
          "category": "Lunch",
          "price": "10.95"
        }
  ]
  }
  </code></pre>
  
  <p>I am using <code>Gson</code> to parse this Json.</p>
  
  <pre><code>URL url = getClass().getClassLoader().getResource("FoodItemData.json");
  
          FileReader fileReader = null;
          try {
              fileReader = new FileReader(url.getPath());
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
          JsonReader jsonReader = new JsonReader(fileReader);
          Gson gson = new Gson();
          JsonParser parser = new JsonParser();
          JsonArray Jarray = parser.parse(jsonReader).getAsJsonArray();
  
          List&lt;FoodItem&gt; listOfFoodItems = new ArrayList&lt;FoodItem&gt;();
  
          for (JsonElement obj : Jarray) {
              FoodItem foodItem = gson.fromJson(obj, FoodItem.class);
              listOfFoodItems.add(foodItem);
          }
  </code></pre>
  
  <p>This code results in <code>java.lang.IllegalStateException: This is not a JSON Array</code> exception. The <code>FoodItem</code> class contains the variables with the same name as in the Json.</p>
  
  <pre><code>public class FoodItem {
      private String id;
      private String name;
      private String description;
      private String category;
      private String price;
      private String country;
  }
  </code></pre>
  
  <p>Am I missing anything here? I tried using the following code as given in <a href="https://stackoverflow.com/questions/9598707/gson-throwing-expected-begin-object-but-was-begin-array?rq=1">this answer</a>, but I got the same exception as the one mentioned in that question. Any help would be appreciated.</p>
  
  <pre><code>Gson gson = new GsonBuilder().create();
  Type collectionType = new TypeToken&lt;List&lt;FoodItem&gt;&gt;(){}.getType(); 
  List&lt;FoodItem&gt; foodItems = gson.fromJson(jsonReader, collectionType);
  </code></pre>