Java: check if datepicker has value error
<p>I have a </p>

<pre><code>DatePicker date = new DatePicker();
date.setValue(LocalDate.now());
</code></pre>

<p>The field is still manually editable, so you can just remove the initial set value.</p>

<p>I have a button with which I want to check if the <code>DatePicker</code> value is empty. But when I do <code>if(date.getValue().equals(null)</code>, I get a <code>java.lang.NullPointerException</code>: </p>

<pre><code>Button btn = new Button();
btn.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
    @Override
    public void handle(ActionEvent evt) {
         if(date.getValue().equals(null) {
            // do something
         }
     }
   });
</code></pre>

<p>How can I properly check if the value is empty?</p>