title: Java Calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY), will it roll backwards, forwards or unknown?
body: <p>Suppose the following code is executed on the 22nd of August 2009 (a Saturday)</p>
  
  <pre><code>   Calendar c = Calendar.getInstance();
     c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
  </code></pre>
  
  <p><code>c.get(Calendar.DAY_OF_MONTH)</code> will return 23.  I'm interested in the conditions is would return 14 (last Sunday, rather than the next Sunday).</p>
  
  <p>Are there any rules associated with the direction Calendar will roll the <code>DAY_OF_MONTH/YEAR</code> when <code>DAY_OF_WEEK</code> is set?  If so what are they?</p>