my for loop is rather long - java
<p>My for loop is too long. As demo there is three for loops going on for methodB. Is there a way I could reduce this to a short for loop (one for loop)? Thanks</p>

<pre><code>    public class MyMates  
    {

       private static TreeSet&lt;String&gt; myTable = new TreeSet&lt;String&gt;();

       private static String[] names1 = null;
       private static String[] names2 = null;
       private static String[] names3 = null;


       public MyMates()
       {
        super();
        myTable = new TreeSet&lt;String&gt;();
       }


       public  static String methodA(String aTemp)
       {
         String[] names1 = new String[] {"Amy", "Jose", "Jeremy", "Alice", "Patrick"};
         String[] names2 = new String[] { "Alan", "Amy", "Jeremy", "Helen", "Alexi"};
         String[] names3 = new String[] { "Adel", "Aaron", "Amy", "James", "Alice" };

         return aTemp;
      } 



    public static String methodB(String bTemp)
     {

        for (int i = 0; i &lt; names1.length; i++) {
        myTable.add(names1[i]);
        }
        System.out.println(myTable);

        for (int i = 0; i &lt; names2.length; i++) {
        myTable.add(names2[i]);
        }
        System.out.println(myTable);

       for (int i = 0; i &lt; names3.length; i++) {
       myTable.add(names3[i]);
       }
       System.out.println(myTable);

    return bTemp;
   }
</code></pre>

<p>enter code here</p>
