title: Junit Test case
body: <p>Consider this class:</p>
  
  <pre><code>public class Test{
  private List&lt;TestDTO&gt; testDTO;
  
  //Some method which uses getTestTypes()
  
  public List&lt;TestDTO&gt; getTestTypes() {
      if (testDTO== null) {
          testDTO = new ArrayList&lt;TestDTO&gt;();
      }
      return testDTO;
  }
  }
  </code></pre>
  
  <p>I am writing a test Case for this method using junit 4. 
  Previously I have written test cases in which an object was being made and checked for nullpointerexception, 
  But how to write it when there is no object made. The return type is an <code>ArrayList</code> with size zero.</p>