@Test
public void testRollingMaxDate() {

  LocalDateTime[] data =
      new LocalDateTime[] {
        LocalDate.of(2011, 1, 1).atStartOfDay(),
        LocalDate.of(2011, 1, 3).atStartOfDay(),
        LocalDate.of(2011, 1, 5).atStartOfDay(),
        LocalDate.of(2011, 1, 7).atStartOfDay(),
        LocalDate.of(2011, 1, 9).atStartOfDay()
      };
  LocalDateTime[] sma5 =
      new LocalDateTime[] {
        null,
        LocalDate.of(2011, 1, 3).atStartOfDay(),
        LocalDate.of(2011, 1, 5).atStartOfDay(),
        LocalDate.of(2011, 1, 7).atStartOfDay(),
        LocalDate.of(2011, 1, 9).atStartOfDay()
      };
  DateTimeColumn result =
      (DateTimeColumn) DateTimeColumn.create("data", data).rolling(2).calc(latestDateTime);
  assertArrayEquals(sma5, result.asObjectArray());
}