title: Save a LocalDate list to an array[][]
body: <p>I would like to save the dates from the list to an array[][]?</p>
  
  <p>My list is</p>
  
  <pre><code>List&lt;LocalDate&gt; dates = getWeekendDates
          (new LocalDate(year, month, (day+2)), new LocalDate((year+1), nymonth ,nyday));
  
  private static List&lt;LocalDate&gt; getWeekendDates
      (LocalDate start, LocalDate end)
  {
      List&lt;LocalDate&gt; result = new ArrayList&lt;LocalDate&gt;();
      for (LocalDate date = start;
           date.isBefore(end);
           date = date.plusDays(1))
      {
          int day = date.getDayOfWeek();
          // These could be passed in...
          if (day == DateTimeConstants.SUNDAY)
          {
              result.add(date);
          }
      }
      return result;
  }   
  </code></pre>
  
  <p>I used :</p>
  
  <pre><code>String[] SundayArray = dates.toArray(new String[dates.size()]);
  System.out.println(SundayArray[5]);
  </code></pre>
  
  <p>This is the error output: </p>
  
  <pre><code>Exception in thread "main" java.lang.ArrayStoreException 
      at java.lang.System.arraycopy(Native Method) 
      at java.util.ArrayList.toArray(Unknown Source) 
      at Test.main(Test.java:27)
  </code></pre>
  
  <p>line 27 is <code>String[] SundayArray = dates.toArray(new String[dates.size()]);</code></p>