ListGenerator { public List<Integer> generate(int length) { List<Integer> generatedList = new ArrayList<Integer>(); for(int i=0;i<length;i++) { generatedList.add((int)Math.round(Math.random()*length)); } return generatedList; }  List<Integer> generate(int length);  }
@Test public void testGenerateEmptyList() throws Exception { assertEquals(0, listGenerator.generate(0).size()); }
@Test public void testEmptyListGeneratedWhenSizeIsNegative() throws Exception { assertEquals(0, listGenerator.generate(-1).size()); }
@Test public void testGenerateSimpleList() throws Exception { assertEquals(10, listGenerator.generate(10).size()); }