title: How to check if all non-primitive elements in object is null
body: <p>Is there any shortcut for checking if an objects all elements(and also their elements) are null. For example I want to check If a country object(and its city and its street) is null or not? I don't want to check them one by one like;</p>
  
  <pre><code>country == null || country.city == null || country.city.street == null
  
  
  public class Country{
  
    City city;
    ....
  
  }
  
  public class City{
  
    Street street;
    ....
  }
  
  public class Street{
    ....
  }
  </code></pre>