code: public static Object setPeriod(final Object task, final long period) {
          return (task instanceof Task) ? ((Task) task).setPeriod(period)
                                        : task;
      }
docs: Sets the periodicity of the designated task to a new value. <p>
  
  If the designated task is cancelled or the new period is identical to the
  task's current period, then this invocation has essentially no effect
  and the submitted object is returned. <p>
  
  Otherwise, if the new period is greater than the designated task's
  current period, then a simple assignment occurs and the submittted
  object is returned. <p>
  
  If neither case holds, then the designated task is cancelled and a new,
  equivalent task with the new period is scheduled for immediate first
  execution and returned to the caller. <p>
  
  @return a task reference, as per the rules stated above.
  @param task the task whose periodicity is to be set
  @param period the new period