title: How to format as well as compare DateTime(if one date is null) in Java 8?
body: <p>How to modify following Date Comparison using Java 8 which reduce whole these methods into less lines which includes Null Safety too?</p>
  
  <pre><code>//Format and convert to date
  private static Date handleDate(String dateInString) {
      if(dateInString == null) {
          return null;
      }
      SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
      try {
          return formatter.parse(dateInString);
      } catch (ParseException e) {
          e.printStackTrace();
          return null;
      }
  }
  
  //Checks if dates are equal
  private static boolean dateEquals(Date date1, Date date2) {
      if (date1 == null &amp;&amp; date2 != null) {
          return false;
      }
      if (date2 == null &amp;&amp; date1 != null) {
          // We already have data, don't want null there then.
          return false;
      }
  
      if (date1 != null &amp;&amp; date2 != null) {
          if(date1.equals(date2)) {
              return true;
          }
      }
      return false;
  }
  
  //Main
  public static void main(String[] args) {
  
      Date current = handleDate("2019-09-02T00:00:00");
      Date existing = handleDate("2019-09-02T01:00:00");
  
      System.out.println(dateEquals(existing, current));
  </code></pre>
  
  <p>Also I do not want to have null check, so is there any utility doing so?</p>