title: JUnit Same testcase with different inputs
body: <p>I need to test a method, eg:</p>
  
  <pre><code>public ObjRet foo(string input)
  {
  ...
  return objRet;
  }
  </code></pre>
  
  <p>For the above method, one test case involves input = {null, " ", "", etc} which would return the same default object and there are other test cases </p>
  
  <p>Do I need to have separate test cases for each input (even though I need to validate for same default object)</p>
  
  <p>or can i do something like this,</p>
  
  <pre><code>@Test
  void testing()
  {
    String[] inputs = {null, "", " "};
    List&lt;ObjRet&gt; received = new List&lt;ObjRet&gt;();
    for(string input : inputs)
       received.add(foo(input));
  
    for(ObjRet obj : received)
        Assert.assertEquals(obj, default);
  }
  </code></pre>
  
  <p>I just want to make sure that if its a good practice to use for loops for assertions</p>