title: Hamcrest check if value is null or empty array
body: <p>I have a code, which returns JSON, where one field might be null or empty array.</p>
  
  <p>I have this code to check:</p>
  
  <pre class="lang-java prettyprint-override"><code>import static org.hamcrest.core.AnyOf.anyOf;
  import static org.hamcrest.CoreMatchers.nullValue;
  import static org.hamcrest.Matchers.blankOrNullString;
  
  // io.restassured.response
  getResponse.then()
     .assertThat()
     .body("entity.fields", anyOf(nullValue(), emptyArray()))
  </code></pre>
  
  <p>But output is unclear</p>
  
  <pre><code>java.lang.AssertionError: 1 expectation failed.
  JSON path entity.fields doesn't match.
  Expected: (null or an empty array)
    Actual: []
  </code></pre>
  
  <p>What is incorreect in this setup?</p>