code: public Date adjustDate(Date date, String type, int delta) {
          Date result = date;
          if (date != null) {
              if (DAY.equals(type)) {
                  result = adjustDate(date, Calendar.DATE, delta);
              } else if (MONTH.equals(type)) {
                  result = adjustDate(date, Calendar.MONTH, delta);
              } else if (HOUR.equals(type)) {
                  result = adjustDate(date, Calendar.HOUR, delta);
              } else if (YEAR.equals(type)) {
                  result = adjustDate(date, Calendar.YEAR, delta);
              } else if (MINUTE.equals(type)) {
                  result = adjustDate(date, Calendar.MINUTE, delta);
              } else if (SECOND.equals(type)) {
                  result = adjustDate(date, Calendar.SECOND, delta);
              } else {
                  throw new IllegalArgumentException("unsupported type: " + type);
              }
          }
          
          return result;
      }
docs: Roll a date forward or back based on the given type where type is one of
  the following. Note that an {@link IllegalArgumentException} is thrown if
  the given type is invalid.
  
  <blockquote>
  <pre>
  Type     Meaning     Constant
  ----     -------     --------
  y       years       {@link DateContext#YEAR}
  M       months      {@link DateContext#MONTH}
  d       days        {@link DateContext#DAY}
  H       hours       {@link DateContext#HOUR}
  m       minutes     {@link DateContext#MINUTE}
  s       seconds     {@link DateContext#SECOND}
  </pre>
  </blockquote>
  
  If the delta is positive, then the given date is rolled forward the given
  value and type. If the delta is negative, then the date is rolled
  backward the given value and type.
  
  @param date The initial date from which to start
  @param type the type of change based on the above types
  @param delta The positive or negative integer value to move
  
  @return The new {@link Date} instance reflecting the specified change