title: How to return a list of strings in Java?
body: <p>I want to return a list of strings when I call the method <code>generateArrayList(2);</code>
  It reminds me <code>"Method does not exist or incorrect signature: void generateArrayList(Integer) from the type anon"</code>
  Anyone help me, please! here is my class:</p>
  
  <pre><code>public class StringArrayTest {      
      public static List&lt;String&gt; generateArrayList(integer n){
          List&lt;String&gt; stringArray = new List&lt;String&gt;();
          for (integer i=0;i&lt;n;i++){
              String str= 'Test'+String.valueOf(i);
              stringArray.add(str);
          }
          return stringArray;
      }
  }
  </code></pre>