title: How to check if some List contains only one particular element OR is empty using AssertJ
body: <p>I have:</p>
  
  <pre><code>@Test
  public void testSomethingInFooFunction() {
      //given
      Something parameter = new Something();
      //when
      List&lt;Object&gt; result = foo(parameter);
      //then
  
      // not working
      assertThat(result).isEmpty().or().containsOnly(something());
      assertThat(result).is(v -&gt; v.isEmpty() || v.containsOnly(something());
  
      //is working
      assertThat(result.isEmpty() || (
          result.contains(something())
          &amp;&amp; result.size() == 1)
      ).isTrue();
  
  }
  </code></pre>
  
  <p>Is there any other way to test condition like:</p>
  
  <blockquote>
    <p>result.isEmpty() || ( result.contains(something()) &amp;&amp; result.size() ==
    1)</p>
  </blockquote>
  
  <p><strong>Q:</strong> How to simplify it with AssertJ 3.11.1 ?</p>