TenorUtils { @Deprecated public static ZonedDateTime getDateWithTenorOffset(final ZonedDateTime dateTime, final Tenor tenor) { return dateTime.minus(tenor.getPeriod()); } protected  TenorUtils(); static double getDaysInTenor(final Tenor tenor); @Deprecated static ZonedDateTime getDateWithTenorOffset(final ZonedDateTime dateTime, final Tenor tenor); @Deprecated static double getTenorsInTenor(final Tenor first, final Tenor second);  }
@Test public void testOffsetDate() { ZonedDateTime dateTime = DateUtils.getUTCDate(2013, 12, 31); assertEquals(DateUtils.getUTCDate(2012, 12, 31), TenorUtils.getDateWithTenorOffset(dateTime, Tenor.ONE_YEAR)); assertEquals(DateUtils.getUTCDate(2013, 11, 30), TenorUtils.getDateWithTenorOffset(dateTime, Tenor.ONE_MONTH)); assertEquals(DateUtils.getUTCDate(2013, 12, 30), TenorUtils.getDateWithTenorOffset(dateTime, Tenor.ONE_DAY)); assertEquals(DateUtils.getUTCDate(2012, 12, 31), TenorUtils.getDateWithTenorOffset(DateUtils.getUTCDate(2013, 1, 1), Tenor.ONE_DAY)); }