title: How to check the variables of an Object are Empty or NULL in JAVA?
body: <p>How to check <code>variables of Objects</code> are <code>empty or NULL</code> in JAVA?</p>
  <pre><code>Employee employee = repository.getEmployee(id).orElseGet(null);
  if (employee == null) {
     employee = new Employee();
     employee.id(1);
     employee.name(&quot;Thirumal&quot;);
     employee.mobile(&quot;+91-8973-697-871&quot;);
     repository.save(employee);
  }
  </code></pre>
  <p>Instead of <code>NULL</code>, I  am trying to create an object <code>new Employee()</code></p>
  <pre><code>Employee employee = repository.getEmployee(id).orElseGet(new Employee());
  if (employee.isEmpty()) { //--------- How to do ????????
     employee = new Employee();
     employee.id(1);
     employee.name(&quot;Thirumal&quot;);
     employee.mobile(&quot;+91-8973-697-871&quot;);
     repository.save(employee);
  }
  </code></pre>
  <p>How to check the <code>member of objects</code> are <code>empty/NULL</code>?</p>