title: how do you test if statements with junit?
body: <p>I can't seem to find any tutorials online that address this</p>
  
  <p>I have this <code>if</code> statement:</p>
  
  <pre><code>if (basket.getCustomerId() != null) {
                  Basket exBasket = findBasketByCustomerId(basket.getCustomerId());
                  if (exBasket != null &amp;&amp; exBasket.getBasketId() != null) {
                      return exBasket;
                  }
  </code></pre>
  
  <p>and I want to write a unit test that will test each individual line to see if it is doing the right thing.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>@Test
      public void testBasketWithANullCustomerId(){
          basketInformationServiceImpl.createBasket(mockBasket);
          assertNotNull(mockBasket.getCustomerId());
      }
  </code></pre>