title: check nested key existence in video object in youtube-api to avoid NULLPOINTEREXCEPTION
body: <p>I want to check the existence of nested key in <code>Video</code> object returned as a Json response from youtube video search by using below code:-</p>
  
  <pre><code>YouTube.Videos.List searchvideostats = youtube.videos().list("snippet,statistics");
  searchvideostats.setKey(apiKey);
  Video v = searchvideostats.execute().getItems().get(0);
  System.out.println(v.toPrettyString());
  </code></pre>
  
  <p>I got output like this:-</p>
  
  <pre><code>{
    "etag" : "\"m2yskBQFythfE4irbTIeOgYYfBU/-TONXAYMx_10Caihcoac4XCyb4I\"",
    "id" : "4Aa9GwWaRv0",
    "kind" : "youtube#video",
    "snippet" : {
      "categoryId" : "10",
  ...................
  .........
  </code></pre>
  
  <p>MY goal is:- how to check whether <strong>categoryId</strong> key is present in this response or not. coz if do <code>v.getSnippet().getCategoryId()</code> it gives <strong>NullPointerException</strong> if categotyId is not present in Json.</p>
  
  <p>Tried:-</p>
  
  <pre><code>if (v.containsKey("id")) {
                     System.out.println("contains");
  } else {
            System.out.println("doesnt contains");
  }
  </code></pre>
  
  <p>this returns <strong>contains</strong> as expected. </p>
  
  <pre><code>if (v.containsKey("categoryId")) {
                     System.out.println("contains");
  } else {
            System.out.println("doesnt contains");
  }
  </code></pre>
  
  <p>This returns <strong>doesnt contains</strong>.. which is not expected. How would I check if this nested key is available? </p>
  
  <p>P.S. -> I have to check many nested such keys.</p>
  
  <p>Thanks for help.</p>